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

Hide a child grid

1 Answer 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 14 Aug 2008, 07:52 AM
Hi,

I have a RagGrid with many child grids at the same level and im trying to hide the child grid if it is empty but im running into problems identifying the empty grids

I have tried looking at prerender and detailtable databind then looking at the items in the grid where the item count is 0 then hiding based on this but the grids always have an item count of 0 they always hide the grid even when they have data in them

e.g.

     GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
     foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
     {
       foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
       {
         if (nestedView.Items.Count == 0)
         {

         if (nestedView.Items.Count == 0)
         {
           nestedView.Visible  = false;

         }


Any Ideas?

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 Aug 2008, 05:36 AM
Hi Paul,

Attached to this message, is a sample application, which handles the requested functionality.
I hope this helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or