I have implemented a hierarchical grid, I do have serveral Parent grid and for each parent grid there are child grids associated. I have 3 columns in the parent grid and 4 columns in the child grid. so when i select the parent grid and do TAB out, it goes upto the 3rd column and then TAB out to the next Parent Row not to the Child grid. how do i achieve this functionality. The tab should work in a way parent then its child and then next parent and then its child and so on.
Thanks,
Shiras
8 Answers, 1 is accepted
In order to tab in the child grid, related to the parent row, you should put the child grid in the RowDetailTemplate of the parent. For example if the parent grid is Clubs and the child grid is Players:
<
Grid.Resources
>
<
DataTemplate
x:Key
=
"RowDetailsTemplate"
>
<
telerik:RadGridView
Name
=
"playersGrid"
ItemsSource
=
"{Binding Players}"
AutoGenerateColumns
=
"True"
>
</
telerik:RadGridView
>
</
DataTemplate
>
</
Grid.Resources
>
<
telerik:RadGridView
Name
=
"clubsGrid"
ItemsSource
=
"{Binding Clubs}"
AutoGenerateColumns
=
"True"
RowDetailsTemplate
=
"{StaticResource RowDetailsTemplate}"
Margin
=
"5"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
You could review this help article and its related sub articles as well.
Didie
the Telerik team
I more concerned about the look and feel of the grid. So i will not be interested to have RowDetailsVisibility as the look and feel is not as good as ChildTableDefinition, especially the expand and collapse button. not only that i dont see any option to expand all the rows at a time. I will appreciate if you could give me a workaround in ChildTableDefinition please.
<
telerikGridView:RadGridView.ChildTableDefinitions>
<telerikGridView:GridViewTableDefinition />
</telerikGridView:RadGridView.ChildTableDefinitions>
Above is how i have implemented the hierachy event. and for the childgrid event on LOADED event i am assigning the ItemSource. So in this scenario please let me know how do i implement TAB control either at the design time or at the runtime.
If i am able to get access to the child grid at runtime, i believe I can implement TAB. I will try to set the focus when the Parent row looses focus to the childgrid. please advice.
Thanks,
Shiras
Unfortunately with the current version TAB navigation in hierarchy (with ChildTableDefinition) is not possible. We will do our best to provide such support for the next official release (2011.Q2). There is another option (except hierarchy with RowDetails) to handle such scenarios. You could override TAB key behavior like demonstrated within this blog post, which will give you a control over TAB key.
Sorry for the inconvenience caused.
Nedyalko Nikolov
the Telerik team
I forgot to link the blog post. Here it is.
Regards,Nedyalko Nikolov
the Telerik team
How do i get to know whether i am in the last column of the parent row and how do i get access to the child grid of the parent so that i can set the focus and then start tabbing.
Please advice.
Thanks
Indeed it is not so easy and trivial. You could get the whole information from the "GridViewDataControl" parameter of the DefaultKeyboardCommandProvider class via radGridView.CurrentCell property. Also you could pass some additional parameters like "last column" and so on.
Regards,Nedyalko Nikolov
the Telerik team