I have a question on the XamDataGrid. I have a datetiem column in the grid. This column's GroupByMode is set to OutlookDate. When I use this column as the group by field. The data rows are grouped by Today, Yesterday and Tuesday. However, the item count is not shown. Is any way to show the item count? The following is a snapshot of the grid.
Hello,
Thank you for your post. I have been looking into it and I suggest you define your DateTime Field like this:
<igDP:Field Name="Date"> <igDP:Field.Settings> <igDP:FieldSettings GroupByMode="OutlookDate"> <igDP:FieldSettings.GroupByRecordPresenterStyle> <Style TargetType="{x:Type igDP:GroupByRecordPresenter}"> <EventSetter Event="Loaded" Handler="GBRPLoaded"/> </Style> </igDP:FieldSettings.GroupByRecordPresenterStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
And add the following handler for the GroupByRecordPresenter’s Loaded event:
private void GBRPLoaded(object sender, RoutedEventArgs e) { GroupByRecord record = ((sender as GroupByRecordPresenter).Record as GroupByRecord); if (record.ChildRecords.Count() == 1) { record.Description += " (" + record.ChildRecords.Count().ToString() + " item)"; } else record.Description += " (" + record.ChildRecords.Count().ToString() + " items)"; }
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thanks. Your suggestion works fine. The problem is solved.
William
Hello William,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks for giving nice solution but i am facing problem in that.When ever i scroll down "GroupByRecordPresenter" is loaded and items are doubling.How can i stop this? i am sending an image my problem.