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

[Solved] How to expand perticular row using GridViewToggleRowDetailsColumn

1 Answer 177 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mahesh Mitkari
Top achievements
Rank 2
Mahesh Mitkari asked on 25 Feb 2011, 05:11 PM
Hi

I am using Silverlight RadGridView control, we are using GridViewToggleRowDetailsColumn to handle the required functionality, since client is very particular about requirement they don’t want to expand that row on mouse click on row they only want to use the Toggle button in first column to expand Detail View  of that row. So we can’t use RadGridView.RowDetailsVisibilityMode we need to depend on GridViewToggleRowDetailsColumn.

My requirement is simple. I want to navigate to particular row in GridView and show RowDetailView of particular row on some external event. Say some click event of a button etc.

Right now i am able to go that that row by setting Selected Item for GridView but am not able to expand that row.

Can someone please suggest some solution for this? How i can expand particular row.

Thank you,
Regards,
Mahesh

1 Answer, 1 is accepted

Sort by
0
Mahesh Mitkari
Top achievements
Rank 2
answered on 25 Feb 2011, 08:50 PM

after lots of search and try and error options finaly following code worked for me.. thought to share with you all..

try
            
                Helpers.Store str = (Helpers.Store)((Image)sender).DataContext; 
    
                if (str != null
                
                    this.RadGridView1.SelectedItem = str; 
    
                    var selectedRow = (GridViewRow)this.RadGridView1.ItemContainerGenerator.ContainerFromItem(this.RadGridView1.SelectedItem); 
    
                    if (selectedRow != null
                        selectedRow.DetailsVisibility = Visibility.Visible; 
                
            
            catch (Exception) 
            {  
                
            }

Tags
GridView
Asked by
Mahesh Mitkari
Top achievements
Rank 2
Answers by
Mahesh Mitkari
Top achievements
Rank 2
Share this question
or