Hi
I have a grid view like this:
Basicaly, a gridview (GridView1) showing items who have sub-items (in GridView2). Please, how do I get the selected item from GridView2?
While the following code is ok:
this one will not compile, as GridView2 is unknown:
Please, how can I get the subtem?
Thanks for your help.
Richard
I have a grid view like this:
<
telerik:RadGridView
x:Name
=
"GridView1"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding ListeMfp}"
SelectionChanged
=
"GridView1_SelectionChanged"
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
/>
</
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Nom}"
Header
=
"Nom "
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Emplacement}"
Header
=
"Emplacement"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Constructeur}"
Header
=
"Constructeur"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Modele}"
Header
=
"Modèle"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
telerik:RadGridView
x:Name
=
"GridView2"
ShowGroupPanel
=
"False"
ItemsSource
=
"{Binding Filtres}"
AutoGenerateColumns
=
"False"
SelectionChanged
=
"Filtres_SelectionChanged"
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
/>
</
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Nom du filtre"
DataMemberBinding
=
"{Binding Nom}"
/>
<
telerik:GridViewDataColumn
Header
=
"Description du filtre"
DataMemberBinding
=
"{Binding DescriptionFiltre}"
/>
<
telerik:GridViewDataColumn
Header
=
"Nombre de sous-filtres"
DataMemberBinding
=
"{Binding NombreSousFiltres}"
/>
</
telerik:RadGridView.Columns
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
</
telerik:RadGridView
>
Basicaly, a gridview (GridView1) showing items who have sub-items (in GridView2). Please, how do I get the selected item from GridView2?
While the following code is ok:
private void GridView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
_Item = GridView1.SelectedItem as ItemObject;
}
this one will not compile, as GridView2 is unknown:
private void GridView2_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
_subItem = GridView2.SelectedItem as SubItem;
}
Please, how can I get the subtem?
Thanks for your help.
Richard