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

GridView indent cell style on grouping

2 Answers 195 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pero
Top achievements
Rank 1
Pero asked on 03 Jun 2016, 09:08 AM

Hi,

could you please be so kind and show me in your grid style (I'm using Windows8 theme) name of style/template where I can remove borders of indent cell on detail row (marked with orange). I want also remove background and border of indent cell on second and third grouping row (marked with dark red) when I have more grouping columns. I was already overide style of first grouping row (in my case MainClassification) but when I have second and third grouping I have indent cell which I want override too. I have Collapsed  "RowIndicatorVisibility" and "RowDetailsVisibilityMode" properties just for your information. My telerik version is 2016.Q2. Thank you very much for your help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 07 Jun 2016, 10:08 AM
Hello Pero,

To achieve the desired effect, you will need to create your custom style targeting the GridViewIndentCell element. Note that if you're using Implicit Styles, you should base this style on the GridViewIndentCellStyle. You can find more information regarding this in our Styling Indent Cells article.

For your convenience, I've extracted the default style for the Windows8 theme and removed the right border:

<Style TargetType="{x:Type telerik:GridViewIndentCell}" BasedOn="{StaticResource GridViewIndentCellStyle}">
    <Setter Property="Background" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.MainBrush}}"/>
    <Setter Property="BorderBrush" Value="{telerik:Windows8Resource ResourceKey={x:Static telerik:Windows8ResourceKey.BasicBrush}}"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:GridViewIndentCell}">
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="25"/>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


I hope you find this helpful. Let me know if you need any further assistance on this.

Regards,
Dilyan Traykov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Pero
Top achievements
Rank 1
answered on 08 Jun 2016, 07:54 AM

Hi Mr. Traykov,

thank you very much for your answer. My issues is resolved.

Kind regards

Tags
GridView
Asked by
Pero
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Pero
Top achievements
Rank 1
Share this question
or