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

hierarchical radgridview expand one row at a time

4 Answers 431 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
peter
Top achievements
Rank 1
peter asked on 16 May 2012, 09:50 AM
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

Sort by
0
Dimitrina
Telerik team
answered on 16 May 2012, 11:41 AM
Hi,

 You can set the ExpandMode property of the GridViewToggleRowDetailsColumn to "Single". That way only a single row can be expanded at a time.

Greetings,
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
Dimitrina
Telerik team
answered on 17 May 2012, 03:38 PM
Hi,

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.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tingting
Top achievements
Rank 1
answered on 05 Jul 2012, 01:36 PM
Hello, 

   I want to know how can i change the size of the icon witch is used to expand a row. 
  
Thank you   
Tags
GridView
Asked by
peter
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
peter
Top achievements
Rank 1
Tingting
Top achievements
Rank 1
Share this question
or