In an ultragrid, when I use groupby feature, is it possible to show the number of rows in the group heading?
Such as:
+ Animals (4 iterms)...........
Hello,
This is done by default when you group:
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc
Thanks.
I have another question: How to change to font and color of the heading text?
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.GroupByRowAppearance.FontData.Name = "Arial"; e.Layout.Override.GroupByRowAppearance.ForeColor = Color.Red; }
Solved, Thanks to you Mike.
i used the following code:
private void Grd_SO_InitializeGroupByRow(object sender, InitializeGroupByRowEventArgs e){
// remove the groupby header caption string[] stringSeparators2 = new string[] { "Product Type :" }; // caption of the group at the beginning string[] result2; result2 = e.Row.Description.Split(stringSeparators2, StringSplitOptions.None); string test2 = string.Join("", result2);
if (test2.Contains('(')) e.Row.Description = test2.Remove(test2.LastIndexOf('(')); //remove the (number of items) else e.Row.Description = test2;
}
//thanks;
Hi,
There are two ways you could do that.
1) Use the InitializeGroupByRow event, just as I mentioned earlier in this thread, and set the Description of the GroupByRow to whatever text you want.
2) Set the GroupByRowDescriptionMask property.
how can we REMOVE this feature, i don't want to see this (2 items) summary in the GroupBy row.
is it possible?
Then you should use the InitializeGroupByRow event. The event passes in the GroupByRow. You can examine the Column, Value, or Description of the row to determine what you need to know about the row. Then use the row's Appearance to apply whatever fonts or colors you like.
What if I only want to change font and color of some of the group heading texts, not all of them?