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

RadGridView Groupiong Row Header

5 Answers 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 22 Jan 2015, 09:39 AM
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.

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Jan 2015, 09:37 AM
Hello Guy,

The column that appears when you apply grouping on the RadGridView are the Indent Cells of the RadGridView. You can check how to customize their style in the above documentation article. For hiding these cells I can suggest you to delete the grid:IndentPresenter tag between line 2025 and 2029 in the Telerik.Windows.Controls.GridView.xaml theme. If you are not comfortable with this approach, you can set the visibility of the IndentPresenter to "Collapsed" using implicit style. You can check how to achieve that in the Setting a Theme Using Implicit Styles documentation article.

Let me know if you need any further assistance.

Best Regards,
Stefan
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.

 
0
Guy
Top achievements
Rank 1
answered on 06 Apr 2015, 11:08 AM
Hi, Re-posting this problem as it wasn't addressed...
0
Accepted
Stefan
Telerik team
answered on 09 Apr 2015, 07:52 AM
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.

 
0
Guy
Top achievements
Rank 1
answered on 13 Apr 2015, 07:09 AM

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.

0
Stefan
Telerik team
answered on 13 Apr 2015, 02:22 PM
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.

 
Tags
GridView
Asked by
Guy
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Guy
Top achievements
Rank 1
Share this question
or