GridView indent cell style on grouping

3 posts, 1 answers
  1. Pero
    Pero avatar
    4 posts
    Member since:
    Nov 2011

    Posted 03 Jun Link to this post


    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. Answer
    Dilyan Traykov
    Dilyan Traykov avatar
    334 posts

    Posted 07 Jun Link to this post

    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">
                <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"/>

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

    Dilyan Traykov
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
  4. Pero
    Pero avatar
    4 posts
    Member since:
    Nov 2011

    Posted 08 Jun in reply to Dilyan Traykov Link to this post

    Hi Mr. Traykov,

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

    Kind regards

Back to Top