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

Toggle RowDetails Column click to select parent record in the grid

4 Answers 172 Views
GridView
This is a migrated thread and some comments may be shown as answers.
AndyL
Top achievements
Rank 1
AndyL asked on 11 Dec 2011, 05:56 PM
Hello,

Could you please give me some hints how to enforce gridview control to mark as selected record for which I'm clicking togglebutton to display rowdetails. I found an example for Silverlight in which it work as desired for my WPF app http://www.telerik.com/community/forums/silverlight/general-discussions/togglebutton.aspx

When I click the rowdetails toggle button it shows that details but also marks the parent row as selected. 

Regards
Andy 

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Dec 2011, 07:25 AM
Hi Andy,

There are a couple of possible approaches here, but still the main idea is to find the corresponding row and set its IsSelected property.
Firstly, you can try to handle RowDetailsVisibilityChanged event:

private void clubsGrid_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
        {
            e.Row.IsSelected = true;
        }

Another possible approach would be to handle the MouseLeftButtonDown event, find the underlying element and its parent row and set its IsSelected property to true.
I hope this helps.


Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
AndyL
Top achievements
Rank 1
answered on 13 Dec 2011, 10:00 AM
Hello Maya,

Thanks for your prompt replay. Unfortunately RowVisibilityChanged event is not firing for me. 
Do you have any project example you could point me to where it works?

Buy the way is it a right RadGridView control behavior that when in VibileWhenSelected mode togglebutton plus is not switching to minus when record is selected?

Best regards
Andy
0
Accepted
Maya
Telerik team
answered on 13 Dec 2011, 10:20 AM
Hello Andyl,

Generally, the two approaches - working with GridViewToggleRowDetailsColumn and setting RowDetailsVisibilityMode - are mutually exclusive. You need to work only with one of them. Considering firing the RowDetailsVisibilityChanged event - I am attaching a sample project illustrating its implementation.
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
AndyL
Top achievements
Rank 1
answered on 13 Dec 2011, 12:29 PM
Thank you for help. I really appreciate this.

Regards
Andy
Tags
GridView
Asked by
AndyL
Top achievements
Rank 1
Answers by
Maya
Telerik team
AndyL
Top achievements
Rank 1
Share this question
or