Hello,
I am using Summaries in Grid control with DisplayFormat as "SubTotal=". This shows the text in group header as well at the end of each group.
I want to remove it from the bottom and only want it visible in header section.
Does anyone know, how can I achieve this?
Thanks,
Hello Vijay,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
Hi Vijay,
By "group header" I assume you mean a GroupByRow. Is that right?
If so, then there's a much easier way than using a CreationFilter. Just use the SummaryDisplayArea property.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; band.SortedColumns.Add("Int32 1", false, true); band.Summaries.Add(SummaryType.Average, band.Columns["Int32 2"]); ov.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRows; }
A possible approach to achieve this might be by using a 'CreationFilter'.
You could read about it at the following link: http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/Win_Creation_Filter.html. Here are some topics from our community which could also help you: http://community.infragistics.com/forums/t/34485.aspx, http://forums.infragistics.com/forums/t/47561.aspx http://community.infragistics.com/forums/t/58186.aspx, http://community.infragistics.com/forums/t/9989.aspx and http://community.infragistics.com/forums/t/50234.aspx. The above approach is not so recommended, because it features element's resizing, creating or removing and could lead to some unexpected behaviors.
I believe that I was able to achieve what you are looking for with the following code sample:
class CF : IUIElementCreationFilter { public void AfterCreateChildElements(UIElement parent) { if (parent is GroupByRowUIElement) { parent.Rect = new Rectangle(parent.Rect.X, parent.Rect.Y - 10, parent.Rect.Width, parent.Rect.Height); } } public bool BeforeCreateChildElements(UIElement parent) { return false; } }
Please do not hesitate to ask if something comes up.