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

Collapse or Expand the grid details on a button click

1 Answer 315 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 14 Dec 2010, 04:14 PM
Hello,

I am using WPF RadGridView, I want to collapse or expand the grid details on a button click of the selected row, I have toggle button on grid , but I want it to be toggled from other button, How can I do that from code behind.

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 14 Dec 2010, 04:28 PM
Hi Rakesh,

You may play along with the Visibility of the RowDetails of the selected row as follows:

private void Button1_Click(object sender, RoutedEventArgs e)
        {
            var row = this.clubsGrid.ItemContainerGenerator.ContainerFromItem(this.clubsGrid.SelectedItem) as GridViewRow;
            if(row != null)
            {
                row.DetailsVisibility = Visibility.Visible;
            }          
        }

 

All the best,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or