Parent and Child Grid Expand All Button

5 posts, 0 answers
  1. Rajini
    Rajini avatar
    15 posts
    Member since:
    Oct 2011

    Posted 19 May 2012 Link to this post

    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
  2. Rajini
    Rajini avatar
    15 posts
    Member since:
    Oct 2011

    Posted 21 May 2012 Link to this post

    Hi ,
    Please reply anybody no one responding. i have a doubt support team is there or not?

    Regards
    Rajini
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2009

    Posted 06 Dec 2012 Link to this post

    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.
  5. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2009

    Posted 08 Dec 2012 Link to this post

    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.
  6. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 15 Jul 2013 Link to this post

    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








Back to Top
UI for WPF is Visual Studio 2017 Ready