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

Clicking on first child row not setting SelectedItem?

2 Answers 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 28 Mar 2011, 04:40 PM
As mentioned in a previous post I have a hierarchical gridview. On the child gridview I'm using the following binding to propogate selecteditem back up to the parent:
SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadGridView, AncestorLevel=1}, Path=SelectedItem, Mode=TwoWay}"

This seems to work in almost every case, except when I click on the first row in one of the child gridviews. For some reason this doesn't seem to change the SelectedItem as I would expect.

2 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 31 Mar 2011, 04:14 PM
Hello Andrew,

Unfortunately I couldn't reproduce the described behavior, utilizing you approach. Could you please, send us a simple demo project, in order to help us provide you better support  to your case. Meanwhile you may have a look at the attached project, where I am proposing you an alternative way to solve this issue.

Regards,
Ivan Ivanov
the Telerik team
0
Andrew
Top achievements
Rank 1
answered on 05 Apr 2011, 04:20 PM
Thanks - between this code and the other posted solution I was able to get things working correctly. The solution was (as suggested) to use a code-behind event handler for SelectionChanged rather than attempting to bind in XAML.
Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or