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

Parent and Child Grid Expand All Button

4 Answers 284 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajini
Top achievements
Rank 1
Rajini asked on 19 May 2012, 08:25 PM
Hi,
Please find the attached Sample image i achived the Parent child relationship grid view now i want expand all the child rows and collapse all the child rows feature how can i achieve this. Urgent needed.

Regards
Rajini

4 Answers, 1 is accepted

Sort by
0
Rajini
Top achievements
Rank 1
answered on 21 May 2012, 08:23 AM
Hi ,
Please reply anybody no one responding. i have a doubt support team is there or not?

Regards
Rajini
0
Jeff
Top achievements
Rank 1
answered on 06 Dec 2012, 10:37 PM
I'm looking for the same exact feature and the fact that you have no responses is troubling. Of course I can make my own button somewhere else in the UI to accomplish the expand/collapse all functionality but the column header position you show seems to be logical place to put it and I don't see any reason why this shouldn't be default functionality with the ability to enable disable the feature. Please let me know if you have made any progress on this yourself and I'll do the same.
0
Jeff
Top achievements
Rank 1
answered on 08 Dec 2012, 05:28 PM
I've entered a request for this feature in PITS but after doing so I don't see it in my searches and I was given no form of link or confirmation to ensure that it actually was entered into the system successfully. When submitting it said it was successful however. I guess we will juts have to wait and see.
0
Steve
Top achievements
Rank 1
answered on 15 Jul 2013, 11:14 PM
Did you ever get a response to this issue?  If not I found a simple (though not elegant) solution.  All I did was follow the GridView with a RadExpander and it displays on top of the grid. 

<telerik:RadGridView x:Name="AccountGroupsGridView"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     IsSynchronizedWithCurrentItem="True"
                     AutoGenerateColumns="False"
                     VerticalGridLinesBrush="Transparent"
                     AlternationCount="2"
                     AlternateRowBackground="AliceBlue"
                     CanUserDeleteRows="True"
                     CanUserInsertRows="True"
                     ColumnWidth="*"
                     ShowGroupPanel="False"
                     RowIndicatorVisibility="Collapsed"
                     Focusable="False"
                     ItemsSource="{Binding Path=AccountGroups}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn x:Name="AccountGroupCodeColumn"
                                    UniqueName="AccountGroupCodeColumn"
                                    Header="{x:Static localProperties:Resources.Account_Group_Code}"
                                    DataMemberBinding="{Binding Path=AccountGroupCode,
                                        Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                    Width="200"
                                    IsReadOnly="False"
                                    IsFilterable="False"
                                    IsGroupable="False"
                                    IsSortable="False"
                                    IsResizable="False"
                                    ShowFieldFilters="False"
                                    ShowFilterButton="False"
                                    ShowDistinctFilters="False">
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn x:Name="DescriptionColumn"
                                    UniqueName="DescriptionColumn"
                                    Header="{x:Static localProperties:Resources.Description}"
                                    Width="*"
                                    DataMemberBinding="{Binding Path=Description,
                                        Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                    IsFilterable="False"
                                    IsGroupable="False"
                                    IsSortable="False"
                                    ShowFieldFilters="False"
                                    ShowFilterButton="False"
                                    ShowDistinctFilters="False">
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.GroupDescriptors>
        <telerik:GroupDescriptor Member="AccountCategory.CategoryName" />
    </telerik:RadGridView.GroupDescriptors>
 
</telerik:RadGridView>
<telerik:RadExpander x:Name="ExpandAll"
                     Style="{StaticResource ExpandAllGroupsStyle}"
                     VerticalAlignment="Top"
                     VerticalContentAlignment="Top"
                     VerticalHeaderAlignment="Top"
                     HorizontalAlignment="Left"
                     HorizontalContentAlignment="Left"
                     HorizontalHeaderAlignment="Left"
                     Collapsed="ExpandAll_Collapsed"
                     Expanded="ExpandAll_Expanded"
                     ToolTip="Expand Collapse All Groups">
</telerik:RadExpander>

Just call GridView.ExpandAllGroups and GridView.CollapseAllGroups in the Expander handlers.  I created an Expander Style to mimic the style of the Group Row.  You can see the result in the attached image








Tags
GridView
Asked by
Rajini
Top achievements
Rank 1
Answers by
Rajini
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Share this question
or