This is a migrated thread and some comments may be shown as answers.

RadGridView hide groups with 0 items

3 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valerio
Top achievements
Rank 1
Valerio asked on 11 Dec 2014, 08:58 AM
Hi Telerik Team,

I'm using a RadGridView with a group descriptor to categorize items belonging to the same group:

<telerik:RadGridView.GroupDescriptors>
<telerik:GroupDescriptor Member="GroupData.Name" />
</telerik:RadGridView.GroupDescriptors>

The problem is that, in order to initialize the application, I needed to define a Dummy group that contains 0 items. The dummy group gets removed once the user makes a selection on the actual groups he wants to analyze.
I don't want the Dummy group to be shown in the grid when the application is loaded. Is there a way to hide it?

Thanks,
Valerio

3 Answers, 1 is accepted

Sort by
0
Valerio
Top achievements
Rank 1
answered on 11 Dec 2014, 09:01 AM
I have to correct myself: the dummy group contains actually a dummy item. I guess my question is if I can customize the GroupDescriptor property in order to show only the groups that have a specific condition.
Sorry for the confusion,

Valerio
0
Dimitrina
Telerik team
answered on 11 Dec 2014, 01:20 PM
Hello Valerio,

Basically you could hide or show rows by adding a FilterDescriptor that filters your items by a certain criteria. You should define the Filtering criteria as explained in the Programmatic Filtering article. As another example, you can check the "Programmatic Filtering" WPF Demo. In your case you define a Dummy group that contains 0 items and I am afraid you cannot hide groups based on a specific condition. 

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Valerio
Top achievements
Rank 1
answered on 12 Dec 2014, 12:57 PM
Thanks Dimitrina,
For some reasons the filtering approach didn't work on my first try. I solved it by modifying the DataContext object.

Valerio
Tags
GridView
Asked by
Valerio
Top achievements
Rank 1
Answers by
Valerio
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or