I need to show the groupby record irrespective of if there is item with that grouping in the list.
Eg: assume I have possible Group values of Group 1, Group 2 and Group 3. And list that is bound to the xamDataGrid is empty. it should show
+Group1 (Count 0)
+Group2(Count 0)
+Group3(Count 0)
Equivalent can be done in ListView by adding all the group description to the collectionview source and binding it to the ListView ItemsSource.
var collectionView = new CollectionViewSource();
var groupDescription = new PropertyGroupDescription("GroupField"); groupDescription.GroupNames.Add("Group 1");
groupDescription.GroupNames.Add("Group 2");
groupDescription.GroupNames.Add("Group 3");
collectionView.GroupDescriptions.Add(groupDescription);
Any suggestions?
Hello Jasvinder,
After some research Show empty Groups has been determine as a new Product Idea. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI12110089
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Hi Stefan,
Thanks for your inputs. I have another issue. The grouping is lost when i filter the collection view such that there are not records left. Is it possible to make sure that groups are showing even when all the records are filtered out.
Attached is the example. Please suggest.
Thanks
Jasvinder
I have been looking into the code you have provided and I can say that the Field that you group by should be included in the FieldLayout, but if you don’t want to show it you can set its Visibility to Collapsed. You can define the FieldLayout like this:
<igDP:FieldLayout > <igDP:FieldLayout.Fields> <igDP:Field Name="Id" Label="ID"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="True" AllowGroupBy="False"/> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Age" Visibility="Collapsed"/> <igDP:Field Name="LastName" Label="Last Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="True" AllowGroupBy="False"/> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
Please let me now if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks grouping work. However, when i set AutoGenerateFields to false, it seems to be stuck. See below, I want to show only certain fields in the grid
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings GroupByEvaluationMode="UseCollectionView" SortEvaluationMode="UseCollectionView" AutoGenerateFields="False"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout > <igDP:FieldLayout.Fields> <igDP:Field Name="ID" Label="ID"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="True" AllowGroupBy="False"/> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="LastName" Label="Last Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="True" AllowGroupBy="False"/> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I set the XamDataGrid’s FieldLayoutSettings’ GroupByEvaluationMode Property to UseCollectionView. Also I handled the GroupByRecordPresenter’s Loaded event in order to set its Description correctly. Please let me now if this helps you or you need further assistance on this matter.