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

Expand row in code

3 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
NoRyb
Top achievements
Rank 1
NoRyb asked on 20 Apr 2010, 10:07 AM
Hello

I would like to expand rows on double click and show rowdetails. I hooked the MouseDoubleClick of the rows in RowLoaded event. Now when the event occurs, I set the "IsExpanded" property of the row which expands an empty row details, only clicking on the row expander column will really expand it.

Is there some kind of "Load" I first have to execute? I didn't find anything in the documentation...

Thanks

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 20 Apr 2010, 10:23 AM
Hello NoRyb,

The IsExpanded property is used to expand a hierarchical row - to expand row details you should use the DetailsVisibility property. For example:

1.private void Button_Click(object sender, RoutedEventArgs e)
2.{
3.    // expand details for first row
4.    var row = this.playersGrid.ItemContainerGenerator.ContainerFromIndex(0) as GridViewRow;
5.  
6.    row.DetailsVisibility = Visibility.Visible;
7.}


All the best,
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
Accepted
Milan
Telerik team
answered on 20 Apr 2010, 10:24 AM
Hello NoRyb,

The IsExpanded property is used to expand a hierarchical row - to expand row details you should use the DetailsVisibility property. For example:

1.private void Button_Click(object sender, RoutedEventArgs e)
2.{
3.    // expand details for first row
4.    var row = this.playersGrid.ItemContainerGenerator.ContainerFromIndex(0) as GridViewRow;
5.  
6.    row.DetailsVisibility = Visibility.Visible;
7.}


All the best,
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
NoRyb
Top achievements
Rank 1
answered on 20 Apr 2010, 10:27 AM
Thank you.
Tags
GridView
Asked by
NoRyb
Top achievements
Rank 1
Answers by
Milan
Telerik team
NoRyb
Top achievements
Rank 1
Share this question
or