Child GridView expander visibility

6 posts, 0 answers
  1. Evgenii
    Evgenii avatar
    3 posts
    Member since:
    May 2012

    Posted 31 Jul 2012 Link to this post

    So, i have radGridView with child 
      <telerik:RadGridView x:Name="radGridView" Grid.Row="5" Grid.ColumnSpan="2"  CanUserFreezeColumns="False" ItemsSource="{Binding ParentCollection}" IsFilteringAllowed="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsReadOnly="True">
                    <telerik:RadGridView.ChildTableDefinitions>
                        <telerik:GridViewTableDefinition/>
                    </telerik:RadGridView.ChildTableDefinitions>
                    <telerik:RadGridView.Columns>
                        <!--some columns -->
                    </telerik:RadGridView.Columns>
                    <telerik:RadGridView.HierarchyChildTemplate  >
                        <DataTemplate>
                            <telerik:RadGridView x:Name="nestedRadGridView" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding ChildCollection}" IsFilteringAllowed="False" ShowGroupPanel="False" IsReadOnly="True">
                                <telerik:RadGridView.Columns>
                         <!--some columns -->
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </DataTemplate>
                    </telerik:RadGridView.HierarchyChildTemplate>
                </telerik:RadGridView>

    need to hide expander of parent grid in rows which have empty child collection. Where i can set style of this togglebutton, tried HierarchyExpandButtonStyle but seems like my style is not applied.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 31 Jul 2012 Link to this post

    Hi,

     I would suggest you to check our custom hierarchy demo for more info. 

    Greetings,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Evgenii
    Evgenii avatar
    3 posts
    Member since:
    May 2012

    Posted 31 Jul 2012 Link to this post

    Where i can find this demo? 
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 31 Jul 2012 Link to this post

    Hi,

     You could download the WPF demos here. After you install them please search for "Custom Hierarchy".

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. lun
    lun avatar
    4 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 in reply to Dimitrina Link to this post

    Hi everyone,

    I post a short reply to help those who want implement this functionality in xaml side only.
    The goal is to set the property 'IsExpandable' dynamically via a DataTrigger :

    <telerik:RadGridView.HierarchyChildTemplate>
      <DataTemplate>
        <telerik:RadGridView AutoGenerateColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Hidden" ShowColumnHeaders="False" ItemsSource="{Binding MySource}">
          <telerik:RadGridView.RowStyle>
            <Style TargetType="telerik:GridViewRow">
              <Setter Property="IsExpandable" Value="True"/>
              <Style.Triggers>
                <DataTrigger Binding="{Binding Path=HasItems}" Value="False">
                  <Setter Property="IsExpandable" Value="False"/>
                </DataTrigger>
              </Style.Triggers>
            </Style>
          </telerik:RadGridView.RowStyle>
          <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding MyProperty}" />
          </telerik:RadGridView.Columns>
        </telerik:RadGridView>
      </DataTemplate>
    </telerik:RadGridView.HierarchyChildTemplate>

    regards,
    Lun@ir
  6. Boris
    Admin
    Boris avatar
    276 posts

    Posted 29 Jan 2015 Link to this post

    Hello lun,

    Thank you for sharing your approach with our community.

    Regards,
    Boris
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top