6 Answers, 1 is accepted
<telerikGridView:RadGridView |
x:FieldModifier="public" |
x:Name="Grid1" |
SelectedItem="{Binding SelectedItem,Mode=TwoWay}" |
ItemsSource="{Binding SomeItems}" |
> |
<telerikGridView:RadGridView.ChildTableDefinitions> |
<telerikGridView:GridViewTableDefinition /> |
</telerikGridView:RadGridView.ChildTableDefinitions> |
<telerikGridView:RadGridView.HierarchyChildTemplate> |
<DataTemplate> |
<telerikGridView:RadGridView |
x:Name="Grid2" |
x:FieldModifier="public" |
ItemsSource="{Binding ChildItems}" |
SelectedItem="{Binding DataContext.SelectedItem,Mode=TwoWay,ElementName=Grid1}" |
/> |
</DataTemplate> |
</telerikGridView:RadGridView.HierarchyChildTemplate> |
</telerikGridView:RadGridView> |
It is actually very strange that the setup was working in the past since you cannot create such bindings in DataTemplates. Nevertheless I am glad that you have found a workaround.
Do not hesitate to write if you need more help.
Greetings,
Milan
the Telerik team
Hi ,
I am using RadGridview for 3 levels of hierarchy.
I want the parent row to be selected whenever the child row is selected.
I tried to set it in the SectionChanged event but its not working. Please let me know if there is any solution.
Regards,
Ganesh
There is not such a built-in option of selection between the hierarchy levels. You can try extending the existing functionality by subscribing for the SelectedChanged events on each details level and handle it as per your requirements.
You can also check the following forum thread: RadGridView - Hierarchy - Selected Parents and Childs.
Regards,
Dimitrina
Telerik
Thanks Dimitrina . I will try it.
I have another issue regarding the RadGridView commit edit on focus lost.
I am setting grid properties ActionOnLostFocus="CommitEdit" EditTriggers="CellClick"
Still, whenever I click on some other control not part of the grid, the value commit is not happening.
eg. I enter some value in the grid cell. and don't press enter. Now I click on the save button in toolbar. It doesn't get the latest value entered in the cell as the commit on focus hasn't finished.
Regards,
Ganesh
I performed some tests and as it turns out I am not able to reproduce an issue when configuring RadGridView with ActionOnLostFocus="CommitEdit" EditTriggers="CellClick", editing a cell and then clicking on a button outside RadGridView.
Since this thread is on another topic, I attached my test application in the support ticket you opened on the same question. We can continue further communication there.
Regards,
Dimitrina
Telerik