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

Expand/Collapse All functionality not working consistenly in Hierarchical RadGridView

1 Answer 316 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.
lakshmi jeeva
Top achievements
Rank 1
lakshmi jeeva asked on 01 Nov 2010, 07:29 PM
Hi,

    I have created hierarchical radgridview.Parent and child relations having different datatables.It is binding properly.

    I am having Expand All/Collapse All functionality.When i open this page all rows are expanded.That is working fine.Suppose grid having more rows then vertical scroll bar will come.If i move scrollbar to bottom and if i click expand/collapse all button.It is not collapsing last row.

    Below is the code for gridview definition 

         

<Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <rwResources:ValueExistsToVisibilityConverter  x:Key="ValueExistsToVisibilityConverter" />
            <ControlTemplate x:Key="AuditDataGridViewRowTemplate" TargetType="tkGridView:GridViewRow">
                <Border BorderThickness="{TemplateBinding BorderThickness}"
      BorderBrush="{TemplateBinding BorderBrush}">
                    <vsm:VisualStateManager.VisualStateGroups>
                        <vsm:VisualStateGroup x:Name="FocusStates">
                            <vsm:VisualState x:Name="Unfocused" />
                            <vsm:VisualState x:Name="Focused">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Visible" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicatorBackground"
                  Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="{StaticResource GridView_RowIndicatorCellBackground_Current}" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="SelectionStates">
                            <vsm:VisualState x:Name="Unselected" />
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="CommonStates">
                            <VisualStateGroup.Transitions>
                                <VisualTransition GeneratedDuration="00:00:00.2000000"
            To="Normal" />
                                <VisualTransition GeneratedDuration="00:00:00.2000000"
            To="MouseOver" />
                                <VisualTransition GeneratedDuration="00:00:00.2000000"
            To="Selected" />
                            </VisualStateGroup.Transitions>
                            <vsm:VisualState x:Name="Normal" />
                            <vsm:VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background_Over"
                  Storyboard.TargetProperty="Opacity">
                                        <EasingDoubleKeyFrame KeyTime="0:0:0"
                Value="1" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Selected">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected"
                  Storyboard.TargetProperty="Opacity">
                                        <EasingDoubleKeyFrame KeyTime="0:0:0"
                Value="1" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="ValueStates">
                            <vsm:VisualState x:Name="Valid" />
                            <vsm:VisualState x:Name="Invalid">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Invalid"
                  Storyboard.TargetProperty="Opacity">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="1" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ErrorIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Visible" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Collapsed" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Collapsed" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="EditStates">
                            <vsm:VisualState x:Name="ReadOnlyMode" />
                            <vsm:VisualState x:Name="EditMode">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Collapsed" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator"
                  Storyboard.TargetProperty="Visibility">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0"
                Value="Visible" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                    </vsm:VisualStateManager.VisualStateGroups>
                    <tkGridView:SelectiveScrollingGrid x:Name="grid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"
          MinHeight="25" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border x:Name="SelectionBackground"
        Grid.Column="2"
        Grid.ColumnSpan="2"
        Background="White"
        Margin="{TemplateBinding Margin}"
        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
        Padding="{TemplateBinding Padding}" />
                        <Border x:Name="Background_Over"
        Margin="1,1,1,2"
        BorderThickness="0"
                          Background="Transparent"
        CornerRadius="1"
        BorderBrush="White"
        Grid.Column="2"
        Grid.ColumnSpan="2"
        Opacity="0">
                            <Border BorderThickness="0"
         BorderBrush="{StaticResource ItemInnerBorder_Over}"
         Background="White" />
                        </Border>
                        <Border x:Name="Background_Selected"
        Margin="1,1,1,2"
        BorderThickness="0"
        CornerRadius="1"
        BorderBrush="White"
                          Background="Transparent"
        Grid.Column="2"
        Grid.ColumnSpan="2"
        Opacity="0">
                            <Border BorderThickness="0"
         BorderBrush="{StaticResource ItemInnerBorder_Selected}"
         Background="Transparent" />
                        </Border>
                        <Border x:Name="Background_Invalid"
        Margin="1,1,1,2"
        BorderThickness="0"
        CornerRadius="1"
        BorderBrush="{StaticResource ItemOuterBorder_Invalid}"
        Grid.Column="2"
        Grid.ColumnSpan="2"
        Opacity="0">
                            <Border BorderThickness="0"
         BorderBrush="{StaticResource ItemInnerBorder_Invalid}"
         Background="White" />
                        </Border>
                        <tkGrid:GridViewToggleButton Grid.Column="2"
               Width="25"
               tkGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
               Opacity="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToOpacityConverter}}"
               IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}"
               Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
               IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        <Border Grid.Column="2"
        tkGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
        Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
                        <tkGridView:DataCellsPresenter Grid.Column="3"  tkControls:StyleManager.Theme="{StaticResource Theme}" x:Name="PART_DataCellsPresenter" />
                        <Border x:Name="PART_RowBorder"
        BorderBrush="Transparent"
        BorderThickness="{Binding HorizontalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Bottom}"
        Grid.ColumnSpan="4"
        Grid.Column="1"
        Grid.RowSpan="4"
        VerticalAlignment="Bottom" />
                        <!-- {StaticResource ControlOuterBorder} -->
                        <Border Background="White"
        Grid.Column="2"
        Grid.Row="2"
        Grid.ColumnSpan="2"
        Padding="0,0,0,0"
        BorderBrush="White"
        BorderThickness="0"
        Visibility="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}">
                            <ContentPresenter x:Name="PART_HierarchyChildPresenter" />
                        </Border>
                        <tkGridView:IndentPresenter x:Name="PART_IndentPresenter"
              tkControls:StyleManager.Theme="{StaticResource Theme}"
              IndentLevel="{TemplateBinding IndentLevel}"
              Grid.Column="1"
              Grid.RowSpan="4"
              tkGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" />
                        <Border x:Name="PART_IndicatorPresenter"
        Width="25"
        VerticalAlignment="Stretch"
        Grid.Column="0"
        Visibility="Collapsed"
        tkGridView:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
        Grid.RowSpan="3"
        BorderBrush="{StaticResource ControlOuterBorder}"
        BorderThickness="0,0,0,0">
                            <Border x:Name="NavigatorIndicatorBackground"
         Background="White"
         BorderBrush="{StaticResource ControlInnerBorder}"
         BorderThickness="0">
                                <Grid>
                                    <Grid x:Name="ErrorIndicator"
         HorizontalAlignment="Center"
         VerticalAlignment="Center"
         Width="16"
         Height="16"
         Visibility="Collapsed">
                                        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground1}"
          Stretch="Fill"
          Margin="1"
          Data="M3,12.999999 L4,12.999999 5,12.999999 6,12.999999 7,12.999999 8,12.999999 9,12.999999 10,12.999999 11,12.999999 11,13.999999 10,13.999999 9,13.999999 8,13.999999 7,13.999999 6,13.999999 5,13.999999 4,13.999999 3,13.999999 z M11,11.999999 L12,11.999999 12,12.999999 11,12.999999 z M2.0000001,11.999999 L3,11.999999 3,12.999999 2.0000001,12.999999 z M12,10.999999 L13,10.999999 13,11.999999 12,11.999999 z M1,10.999999 L2.0000001,10.999999 2.0000001,11.999999 1,11.999999 z M13,2.9999992 L14,2.9999992 14,3.9999992 14,4.9999992 14,5.9999992 14,6.9999992 14,7.9999992 14,8.9999992 14,9.9999992 14,10.999999 13,10.999999 13,9.9999992 13,8.9999992 13,7.9999992 13,6.9999992 13,5.9999992 13,4.9999992 13,3.9999992 z M0,2.9999992 L1,2.9999992 1,3.9999992 1,4.9999992 1,5.9999992 1,6.9999992 1,7.9999992 1,8.9999992 1,9.9999992 1,10.999999 0,10.999999 0,9.9999992 0,8.9999992 0,7.9999992 0,6.9999992 0,5.9999992 0,4.9999992 0,3.9999992 z M12,1.9999999 L13,1.9999999 13,2.9999992 12,2.9999992 z M1,1.9999999 L2.0000001,1.9999999 2.0000001,2.9999992 1,2.9999992 z M11,0.99999994 L12,0.99999994 12,1.9999999 11,1.9999999 z M2.0000001,0.99999994 L2.9999998,0.99999994 2.9999998,1.9999999 2.0000001,1.9999999 z M2.9999998,0 L3.9999998,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 3.9999998,0.99999994 2.9999998,0.99999994 z" />
                                        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground2}"
          Stretch="Fill"
          Margin="7,3"
          Data="M1.4901161E-07,8 L1.0000001,8 2.0000002,8 2.0000002,9 2.0000002,10 1.0000003,10 1.0000003,9 1.0000001,10 1.4901161E-07,10 1.4901161E-07,9 z M1.4901161E-07,0 L1.0000001,0 2.0000002,0 2.0000002,1 2.0000002,2 2.0000002,3 2.0000002,4.0000001 2.0000002,5 2.0000002,5.9999999 2.0000002,7 1.0000001,7 1.4901161E-07,7 1.4901161E-07,5.9999999 1.4901161E-07,5 1.4901161E-07,4.0000001 1.4901161E-07,3 1.4901161E-07,2 0,1 z" />
                                        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground3}"
          Stretch="Fill"
          Data="M4,15 L5,15 6,15 7,15 8,15 9,15 10,15 11,15 12,15 12,16 11,16 10,16 9,16 8,16 7,16 6,16 5,16 4,16 z M12,14 L13,14 13,15 12,15 z M3,14 L4,14 4,15 3,15 z M13,13 L14,13 14,14 13,14 z M2,13 L3,13 3,14 2,14 z M14,12 L15,12 15,13 14,13 z M1,12 L2,12 2,13 1,13 z M7,11 L7,12 7,13 8,13 9,13 9,12 9,11 8,11 z M15,4 L16,4 16,5 16,6 16,7 16,8 16,9 16,10 16,11 16,12 15,12 15,11 15,10 15,9 15,8 15,7 15,6 15,5 z M0,4 L1,4 1,5 1,6 1,7 1,8 1,9 1,10 1,11 1,12 0,12 0,11 0,10 0,9 0,8 0,7 0,6 0,5 z M14,3 L15,3 15,4 14,4 z M7,3 L7,4 7,5 7,6 7,7 7,8 7,9 7,10 8,10 9,10 9,9 9,8 9,7 9,6 9,5 9,4 9,3 8,3 z M1,3 L2,3 2,4 1,4 z M13,2 L14,2 14,3 13,3 z M4,2 L5,2 6,2 7,2 8,2 9,2 10,2 11,2 12,2 12,3 13,3 13,4 14,4 14,5 14,6 14,7 14,8 14,9 14,10 14,11 14,12 13,12 13,13 12,13&#xd;&#xa;12,14 11,14 10,14 9,14 8,14 7,14 6,14 5,14 4,14 4,13 3,13 3,12 2,12 2,11 2,10 2,9 2,8 2,7 2,6 2,5 2,4 3,4 3,3&#xd;&#xa;4,3 z M2,2 L3,2 3,3 2,3 z M12,1 L13,1 13,2 12,2 z M3,1 L4,1 4,2 3,2 z M4,0 L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1 z" />
                                    </Grid>
                                    <Grid x:Name="NavigatorIndicator"
         HorizontalAlignment="Center"
         VerticalAlignment="Center"
         Width="9"
         Height="9"
         Visibility="Collapsed">
                                        <Path Fill="{StaticResource GridView_NavigatorIndicatorBackground}"
          Stroke="{StaticResource GridView_NavigatorIndicatorBorder}"
          StrokeThickness="1"
          Data="M0.5,0.5 L8.5,4.4375 0.5,8.5 z" />
                                    </Grid>
                                    <Grid x:Name="EditIndicator"
         HorizontalAlignment="Center"
         VerticalAlignment="Center"
         Width="16"
         Height="10"
         Visibility="Collapsed">
                                        <Path Fill="{StaticResource GridView_EditIndicatorBackground1}"
          Stretch="Fill"
          Data="M14,9 L15,9 15,10 14,10 z M1,9 L2,9 2,10 1,10 z M15,8 L16,8 16,9 15,9 z M0,8 L1,8 1,9 0,9 z M15,1 L16,1 16,2 15,2 z M0,1 L1,1 1,2 0,2 z M14,0 L15,0 15,1 14,1 z M1,0 L2,0 2,1 1,1 z" />
                                        <Path Fill="{StaticResource GridView_EditIndicatorBackground2}"
          Stretch="Fill"
          Margin="1"
          Data="M0.99999994,6.9999995 L2,6.9999995 3,6.9999995 4,6.9999995 5,6.9999995 6,6.9999995 7,6.9999995 8,6.9999995 9,6.9999995 10,6.9999995 11,6.9999995 12,6.9999995 13,6.9999995 13,7.9999995 12,7.9999995 11,7.9999995 10,7.9999995 9,7.9999995 8,7.9999995 7,7.9999995 6,7.9999995 5,7.9999995 4,7.9999995 3,7.9999995&#xd;&#xa;2,7.9999995 0.99999994,7.9999995 z M13,0.99999994 L14,0.99999994 14,1.9999999 14,2.9999995 14,3.9999995 14,4.9999995 14,5.9999995 14,6.9999995 13,6.9999995 13,5.9999995 13,4.9999995 13,3.9999995 13,2.9999995 13,1.9999999 z M0,0.99999994 L0.99999994,0.99999994 0.99999994,1.9999999 0.99999994,2.9999995 0.99999994,3.9999995 0.99999994,4.9999995 0.99999994,5.9999995 0.99999994,6.9999995 0,6.9999995 0,5.9999995 0,4.9999995 0,3.9999995 0,2.9999995 0,1.9999999 z M11,0 L12,0 13,0 13,0.99999994 12,0.99999994 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 4,0.99999994 3,0.99999994 2,0.99999994 0.99999994,0.99999994 0.99999994,2.3841858E-07 2,2.3841858E-07 3,2.3841858E-07 4,2.3841858E-07 5,2.3841858E-07 6,2.3841858E-07 7,2.3841858E-07 8,2.3841858E-07&#xd;&#xa;9,2.3841858E-07 10,2.3841858E-07 z" />
                                        <Path Fill="{StaticResource GridView_EditIndicatorBackground3}"
          Stretch="Fill"
          Data="M2,9 L3,9 4,9 5,9 6,9 7,9 8,9 9,9 10,9 11,9 12,9 13,9 14,9 14,10 13,10 12,10 11,10 10,10 9,10 8,10 7,10 6,10 5,10 4,10&#xd;&#xa;3,10 2,10 z M14,8 L15,8 15,9 14,9 z M1,8 L2,8 2,9 1,9 z M15,2 L16,2 16,3 16,4 16,5 16,6 16,7 16,8 15,8 15,7 15,6 15,5 15,4 15,3 z M3,2 L4,2 5,2 6,2 6,3 5,3 5,4 5,5 5,6 5,7 6,7 6,8 5,8 4,8 3,8 3,7 4,7 4,6 4,5 4,4 4,3 3,3 z M0,2 L1,2 1,3 1,4 1,5 1,6 1,7 1,8 0,8 0,7 0,6 0,5 0,4 0,3 z M14,1 L15,1 15,2 14,2 z M1,1 L2,1 2,2 1,2 z M2,0 L3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 13,0 14,0 14,1 13,1 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1&#xd;&#xa;3,1 2,1 z" />
                                        <Path Fill="{StaticResource GridView_EditIndicatorBackground4}"
          Stretch="Fill"
          Margin="2"
          Data="M4,0 L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 12,2 12,3 12,4 12,5.0000001 12,6 11,6 10,6 9,6 8,6 7,6 6,6 5,6 4,6 4,5.0000001&#xd;&#xa;3,5.0000001 3,4 3,3 3,2 3,1 4,1 z M0,0 L1,0 1,1 2,1 2,2 2,3 2,4 2,5.0000001 1,5.0000001 1,6 0,6 0,5.0000001 0,4 0,3 0,2 0,1 z" />
                                    </Grid>
                                </Grid>
                            </Border>
                        </Border>
                    </tkGridView:SelectiveScrollingGrid>
                </Border>
            </ControlTemplate>
            <Style TargetType="tkGridView:GridViewRow" x:Key="AuditDataParentGridViewRowStyle">
                <Setter Property="Template" Value="{StaticResource AuditDataGridViewRowTemplate}" />
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="BorderThickness" Value="1,1,1,0" />
                <Setter Property="MinHeight" Value="20" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="VerticalContentAlignment" Value="Stretch" />
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                <Setter Property="Padding" Value="0,5,0,0" />
            </Style>
            <Style TargetType="tkGridView:GridViewRow" x:Key="AuditDataChildGridViewRowStyle">
                <Setter Property="Template" Value="{StaticResource AuditDataGridViewRowTemplate}" />
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="MinHeight" Value="20" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="VerticalContentAlignment" Value="Stretch" />
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                <Setter Property="Padding" Value="0" />
            </Style>
            <Style TargetType="tkGrid:RadGridView" x:Key="AuditDataGridViewStyle">
                <Setter Property="Background" Value="White" />
                <Setter Property="BorderBrush" Value="White" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="GroupPanelBackground" Value="White"/>
            </Style>

        </Grid.Resources>
        <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
              <Button x:Name="cmdExpand" Content="Summary Only"  IsEnabled="False" Height="20" HorizontalAlignment="Left" Grid.Row="0"/>
               <Button x:Name="cmdExportToExcel" Content="Copy to Clipboard" IsEnabled="False" Height="20"  HorizontalAlignment="Right" Grid.Row="0"/>
 
         <tkGrid:RadGridView x:Name="grdAuditData"  Grid.Row="1"
     AutoGenerateColumns="False"
     ShowGroupPanel="False"
     Visibility="Visible" 
     RowIndicatorVisibility="Collapsed" 
     ShowColumnFooters="False"
     ShowGroupFooters="False" 
     ScrollViewer.VerticalScrollBarVisibility="Auto"
     ScrollViewer.HorizontalScrollBarVisibility="Auto"
     GridLinesVisibility="None"
     CanUserFreezeColumns="False"
     CanUserInsertRows="False"
     CanUserResizeColumns="True"
                    CanUserSelect="False"                          
     BorderThickness="0" 
                    ScrollMode="RealTime"
     Background="{StaticResource Brush_WindowBackground}"
                    RowStyle="{StaticResource AuditDataParentGridViewRowStyle}"
     
     IsReadOnly="True" >
            <tkGrid:RadGridView.Columns>
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding AuditTime}" Header="Modified Date Time" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding Record}" Header="Record" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding Action}" Header="Action" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding User}" Header="Database Account" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding AuditNo_PK}" Header="Audit PK"/>
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding Audited_PK}" Header="Audited PK" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding UserName}" Header="User Name" />
                <tkGrid:GridViewDataColumn DataMemberBinding="{Binding EmployeeID}" Header="Employee ID" />
            </tkGrid:RadGridView.Columns>   
    <tkGrid:RadGridView.HierarchyChildTemplate>
                <DataTemplate>     
      <tkGrid:RadGridView x:Name="grdAuditDataChild" CanUserFreezeColumns="False"
          ShowColumnHeaders="False"
                                        Background="{StaticResource Brush_WindowBackground}"
                                        RowStyle="{StaticResource AuditDataChildGridViewRowStyle}"
                                        AutoGenerateColumns="False"           
                                        ItemsSource="{Binding Details}"
                                        Margin="0,-4,0,0" 
                                        ShowGroupPanel="False"
                                        IsReadOnly="True"                      
                                        GroupPanelBackground="White"
                         CanUserInsertRows="False"
                         CanUserResizeColumns="True"
                                        CanUserSelect="False"
          BorderBrush="{StaticResource Brush_WindowBackground}"
                         BorderThickness="1,0,1,0">
                        <tkGrid:RadGridView.Columns>
                            <tkGrid:GridViewDataColumn Width="40">
                                <tkGrid:GridViewDataColumn.CellStyle>
                                    <Style TargetType="tkGridView:GridViewCell">
                                        <Setter Property="Background" Value="{StaticResource Brush_WindowBackground}" />
                                        <Setter Property="BorderThickness" Value="0" />
                                    </Style>
                                </tkGrid:GridViewDataColumn.CellStyle>
                            </tkGrid:GridViewDataColumn>
                            <tkGrid:GridViewDataColumn MinWidth="150" DataMemberBinding="{Binding Field}">
                                <tkGrid:GridViewDataColumn.CellStyle>
                                    <Style TargetType="tkGridView:GridViewCell">
                                        <Setter Property="Padding" Value="6,0,0,0" />
                                    </Style>
                                </tkGrid:GridViewDataColumn.CellStyle>
                            </tkGrid:GridViewDataColumn>
                            <tkGrid:GridViewDataColumn MinWidth="150"  DataMemberBinding="{Binding OldValue}">
                                <tkGrid:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid HorizontalAlignment="Stretch">
                                            <TextBlock Text="{Binding OldValue}" Margin="5,0,0,0" x:Name="txtOldValueText" HorizontalAlignment="Left"/>
                                            <Line Margin="5,0,0,0" StrokeThickness="1" Stroke="Red" Y1="7" Y2="7" X1="0" X2="150" HorizontalAlignment="Left" Visibility="{Binding OldValue, Converter={StaticResource ValueExistsToVisibilityConverter}}" Width="{Binding Path=ActualWidth,  ElementName=txtOldValueText}" />
                                        </Grid>
                                    </DataTemplate>
                                </tkGrid:GridViewDataColumn.CellTemplate>
                            </tkGrid:GridViewDataColumn>
                            <tkGrid:GridViewDataColumn MinWidth="150"  DataMemberBinding="{Binding NewValue}" />
                        </tkGrid:RadGridView.Columns>
                    </tkGrid:RadGridView>     
    </DataTemplate>
            </tkGrid:RadGridView.HierarchyChildTemplate>
        </tkGrid:RadGridView>
      <Button x:Name="cmdClose" Content="Close" IsEnabled="False" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2"/>

   </Grid>



       I am binding grid like this 

        

If

 

 

Headers.Count > 0 Then

 

 

 

'Dim oDT As Silverlight.DataTable

 

 

 

Dim definition As New GridViewTableDefinition()

 

definition.Relation =

 

New PropertyRelation("Details")

 

grdAuditData.ChildTableDefinitions.Add(definition)

 

 

Me.grdAuditData.ItemsSource = Headers

 

 

 

else

 

 

 

MessageBox.Show("No Records returned", "Data Validation Errors", MessageBoxButton.OK)

 

 

 

Me.Close()

 

 

 

End If

  Below is the code for ExpandAll/Collpase All button.

    Me.grdAuditData.ExpandAllHierarchyItems() 'For expand all rows

 

 

 

 

   

 

    Me.grdAuditData.CollapseAllHierarchyItems() 'For Collapse all rows.

Herewith i have attcahed the screenshot.Could you please help me why it is not working consistenly.

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 03 Nov 2010, 05:30 PM
Hello lakshmi jeeva,

Basically, you can use the ExpandAllHierarchicalItems() and CollapseAllHierarchicalItems() even for items that are not visible at the moment. So, there is supposed to be no problem on collapsing all of them at once. However, please share a bit more information about your exact specifications. What version of RadGridView are you using ? Are you working with Silverlight 3 or Silverlight 4 ? What is the type of your ItemsSource ? Do you use a DataTable ?
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
lakshmi jeeva
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or