Hi,
I've tried make my grid group by a "DateTime" column based on the Date rather than Date & Time. If I just use the default Group By header and drag my datetime column into the group by header, it groups the row by the exact date & time, which made each row its own group since all rows does not have the exact date & time (i.e. there are many rows within one day but different times).
Thanks!
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns["DateTime 1"].GroupByMode = GroupByMode.Date; }
You might want to try GroupByMode.OutlookDate, instead.
Thank you Mike, that worked like a charm! By the way, when I grouped the rows, the group by header shows "DateTime: 6/27/2006 (2 items)", is there anyway to override the default text and make it shows "Tuesday, Jun 27, 2006 (2 Records)" or some other custom text? Or better yet, change the color and apperance of the group by header? Thanks!
Yes, you can do any or all of the above.
You can change the text on the GroupByRow in a couple of ways. One would be to use the GroupByRowDescriptionMask property. I suspect this will not be robust enough for you, though. So you will probably want to handle the InitializeGroupByRow event and set the Description property on the row.
You can change the Appearance of an individual GroupByRow inside this event, also. Of you can use properties on the Override object like GroupByRowAppearance to apply an appearance to all GroupByRows.