This question is locked. New answers and comments are not allowed.
Hi I have a radgridview which contains a child radgridview. I want only one row to be expanded at a time, however I am having problems getting this done. Can someone please let me know the correct way on achieving this. Thanks
4 Answers, 1 is accepted
0
Hi,
Didie
the Telerik team
You can set the ExpandMode property of the GridViewToggleRowDetailsColumn to "Single". That way only a single row can be expanded at a time.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
peter
Top achievements
Rank 1
answered on 16 May 2012, 11:59 AM
<
Telerik:RadGridView
x:Name
=
"staticDataRadGrid"
IsSynchronizedWithCurrentItem
=
"True"
SelectedItem
=
"{Binding Path=EventCollectionDTO, Source={StaticResource vm}, Mode=TwoWay}"
CurrentItem
=
"{Binding Path=EventCollectionDTO, Source={StaticResource vm}, Mode=TwoWay}"
Grid.Row
=
"1"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding PagedSource, ElementName=_radDataPager,Mode=TwoWay}"
CanUserFreezeColumns
=
"False"
VerticalContentAlignment
=
"Stretch"
HorizontalContentAlignment
=
"Stretch"
ShowGroupPanel
=
"False"
SelectionMode
=
"Single"
>
<
Telerik:RadGridView.Columns
>
<
Telerik:GridViewToggleRowDetailsColumn
ExpandMode
=
"Single"
/>
<
Telerik:GridViewDataColumn
Header
=
"Entity Name"
TextWrapping
=
"Wrap"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding EventHeader.EntityName}"
IsGroupable
=
"False"
Width
=
"2*"
/>
</
Telerik:RadGridView.Columns
>
<
Telerik:RadGridView.ChildTableDefinitions
>
<
Telerik:GridViewTableDefinition
>
<
Telerik:GridViewTableDefinition.Relation
>
<
Telerik:TableRelation
IsSelfReference
=
"False"
>
<
Telerik:TableRelation.FieldNames
>
<
Telerik:FieldDescriptorNamePair
ParentFieldDescriptorName
=
"ID"
ChildFieldDescriptorName
=
"EventID"
/>
</
Telerik:TableRelation.FieldNames
>
</
Telerik:TableRelation
>
</
Telerik:GridViewTableDefinition.Relation
>
</
Telerik:GridViewTableDefinition
>
</
Telerik:RadGridView.ChildTableDefinitions
>
<
Telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
Telerik:RadGridView
x:Name
=
"staticDataEventDetailRadGrid"
CanUserFreezeColumns
=
"False"
CanUserResizeColumns
=
"False"
CanUserResizeRows
=
"False"
MinWidth
=
"800"
MaxWidth
=
"850"
VerticalAlignment
=
"Stretch"
CurrentItem
=
"{Binding Path=EventDetailDTO, Source={StaticResource vm}, Mode=TwoWay}"
SelectedItem
=
"{Binding Path=EventDetailDTO, Source={StaticResource vm}, Mode=TwoWay}"
Style
=
"{StaticResource CustomRadGridViewStyle}"
AutoExpandGroups
=
"False"
IsSynchronizedWithCurrentItem
=
"True"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding EventDetails,Mode=TwoWay}"
ShowGroupPanel
=
"False"
IsReadOnly
=
"True"
>
<
Telerik:RadGridView.Columns
>
<
Telerik:GridViewToggleRowDetailsColumn
ExpandMode
=
"Single"
/>
<
Telerik:GridViewDataColumn
TextWrapping
=
"Wrap"
DataMemberBinding
=
"{Binding EventProcess, ValidatesOnExceptions=False, ValidatesOnDataErrors=False, ValidatesOnNotifyDataErrors=False,NotifyOnValidationError=False}"
Header
=
"Process"
IsGroupable
=
"False"
Width
=
"3*"
/>
</
Telerik:RadGridView.Columns
>
</
Telerik:RadGridView
>
</
DataTemplate
>
</
Telerik:RadGridView.HierarchyChildTemplate
>
</
Telerik:RadGridView
>
Hi i tried this and it still didnt work, my xaml is pasted above incase it helps. Thanks
0
Accepted
Hi,
The suggested approach will work with Row Details.
Didie
the Telerik team
The suggested approach will work with Row Details.
You use Hierarchy with ChildTableDefinitions. In that case you can handle RowIsExpandedChanged event of RadTreeListView and control the expand of the items.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0