RadGridView Groupiong Row Header

5 posts, 1 answers
  1. Guy
    Guy avatar
    6 posts
    Member since:
    Jan 2015

    Posted 22 Jan 2015 Link to this post

    Hello,

    I'm using telerik 2012 for WPF (Telerik.Windows.Controls.GridView.dll file version is 2012.3.1129.40).

    When applying grouping on a RadGridView, a row header is added, colored dark grey, in my case.

    In addition, a narrow column appears as a first column.

    Please see attached screenshot.

    Can it be hidden? Can its style be customized?

    Thanks,
    Guy E.
  2. Guy
    Guy avatar
    6 posts
    Member since:
    Jan 2015

    Posted 06 Apr 2015 in reply to Guy Link to this post

    Hi, Re-posting this problem as it wasn't addressed...
  3. Answer
    Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 09 Apr 2015 Link to this post

    Hi Guy,

    Despite the fact that the referred element visually appears like a column, it is actually not. It is a combination of different type of IndentCells. Please refer to the documentation article from my previous post to check each IndentCell type. So, for example, if you want to hide the element of type GridViewIndentCell you can apply an implicit style, as suggested below:
    <Style TargetType="telerik:GridViewIndentCell"
           BasedOn="{StaticResource GridViewIndentCellStyle}">
        <Setter Property="Visibility" Value="Collapsed"/>
    </Style>

    The same approach would be valid for an element of type GridViewHeaderIntentCell or GridViewFooterIndentCell. The following code snippet demonstrates how an implicit style, targeting  GridViewHeaderIndentCell, can be defined:
    <Style TargetType="telerik:GridViewHeaderIndentCell"
           BasedOn="{StaticResource GridViewHeaderIndentCellStyle}">
        <Setter Property="Visibility" Value="Collapsed"/>
    </Style>

    I hope I have clarified your question.

    Best Regards,
    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  4. Guy
    Guy avatar
    6 posts
    Member since:
    Jan 2015

    Posted 13 Apr 2015 in reply to Stefan Link to this post

    Hi,

     Thanks for your reply.

     I've set the IndentCell visibility, and it works ok.

     A new smaller problem is a graphical one, please see attached screenshot.

     When the groups are expanded, a border line is missing only from the collapse/expand button.

    Is there a way to fix this? 

     Thanks,

    Guy E.

  5. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 13 Apr 2015 Link to this post

    Hello Guy,

    This behavior is reproducible due to an animation applied when expanding/collapsing groups.

    In order to achieve the desired customization, you will need to apply different modifications to RadGridView's Template, depending on what value you have set to the GroupRenderMode property of RadGridView. Please note, that the default value of this property is "Nested". You can find more information on this topic in the Grouping Modes documentation article.

    So, if you have left  RadGridView with its default GroupRenderMode state, please search for the following ControlTemplate:
    <ControlTemplate x:Key="GridViewGroupRowTemplate" TargetType="grid:GridViewGroupRow"

    Within it you need to remove the following animations:
    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconOuterBorder" Storyboard.TargetProperty="BorderThickness">
        <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
                <Thickness>0</Thickness>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconInnerBorder" Storyboard.TargetProperty="BorderThickness">
        <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
                <Thickness>1 1 0 0</Thickness>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>


    If you have set the GroupRenderMode of RadGridView to "Flat", please search for the below ControlTemplate:
    <ControlTemplate x:Key="GroupHeaderRowTemplate" TargetType="grid:GroupHeaderRow">

    Within it remove the following VisualState:
    <VisualState x:Name="Expanded">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconOuterBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Thickness>0</Thickness>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconInnerBorder" Storyboard.TargetProperty="BorderThickness">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Thickness>1 1 0 0</Thickness>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>


    I hope this helps.

    Best Regards,
    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top