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

IsExpanded

5 Answers 212 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jokerwolf
Top achievements
Rank 1
Jokerwolf asked on 28 Jul 2010, 06:32 AM
Hello,
When the data is loaded the DataLoaded event occeres, there we get the grid's Items.count and if Items.Count == 0 we need to expand the only row the grid holds.

5 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 28 Jul 2010, 11:00 AM
Hi Jokerwolf,

Could you please share more information about the problem? If Items.Count is zero there will be no items to be shown and no row could be expanded?


Kind regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jokerwolf
Top achievements
Rank 1
answered on 28 Jul 2010, 11:18 AM
If Items.count = 0 then there will be no rows. I need to automaticly expand the row if it is the only row in the grid.
0
Jokerwolf
Top achievements
Rank 1
answered on 28 Jul 2010, 12:14 PM
Well, I've solved the problem by catching RowLoaded event and setting IsExpanded to true if grid.items.count == 1.
0
Jokerwolf
Top achievements
Rank 1
answered on 28 Jul 2010, 12:53 PM
Still need help with auto close for rows. When we close an expanded row, all its child expanded rows should close too, so when we expand this row again  no child rows are expanded. I tried Row.IsVisibleChanged and it works fine, but that doesn't suite us, cause our application uses several tabs, so when we go to another tab, all rows becom invisible and close.
0
Accepted
Milan
Telerik team
answered on 30 Jul 2010, 12:38 PM
Hello Jokerwolf,

With today's Internal Build we will introduce new event of RadGridView called RowIsExpandedChanged which can be utilized in you application.

void clubsGrid_RowIsExpandedChanged(object sender, Telerik.Windows.Controls.GridView.RowEventArgs e)
{
    var row = e.Row as GridViewRow;
    var grid = e.OriginalSource as GridViewDataControl;
  
    // if row was collapsed and that row was on the root grid
    if (!row.IsExpanded && grid == this.rootGrid)
    {
        var childGrid = row.ChildrenOfType<GridViewDataControl>().FirstOrDefault();
  
        if (childGrid != null)
            childGrid.CollapseAllHierarchyItems();
    }
}


Best wishes,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Jokerwolf
Top achievements
Rank 1
Answers by
Milan
Telerik team
Jokerwolf
Top achievements
Rank 1
Share this question
or