RadGridView hide groups with 0 items

4 posts, 0 answers
  1. Valerio
    Valerio avatar
    9 posts
    Member since:
    Sep 2014

    Posted 11 Dec 2014 Link to this post

    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
  2. Valerio
    Valerio avatar
    9 posts
    Member since:
    Sep 2014

    Posted 11 Dec 2014 in reply to Valerio Link to this post

    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
  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 11 Dec 2014 Link to this post

    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.

     
  4. Valerio
    Valerio avatar
    9 posts
    Member since:
    Sep 2014

    Posted 12 Dec 2014 in reply to Dimitrina Link to this post

    Thanks Dimitrina,
    For some reasons the filtering approach didn't work on my first try. I solved it by modifying the DataContext object.

    Valerio
Back to Top