We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid row header cell styling applies on Table summary as well

Hello support,

I'm trying to apply a style to the row header cell, but it's applying to the table summary row as well.
How can I have such a style only on record rows scope.
Here under is my style:

    <Style x:Key="mySfDatagrid_GridRowHeaderCell_Template" TargetType="syncfusion:GridRowHeaderCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="syncfusion:GridRowHeaderCell">
                        <Border x:Name="PART_RowHeaderCellBorder"
                        Background="Bisque"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid>
                                <TextBlock HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Text="{Binding someRecordProperty}"
                                    TextAlignment="Center" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>

            </Setter>
        </Style>

thank you for your help
Jean-Marc

2 Replies

SA Saravanan Ayyanar Syncfusion Team December 30, 2019 03:03 PM UTC

Hi JMKAL, 
 
Thank you for using Syncfusion controls. 
 
We have analyzed your query related to the following issue “Grid row header cell styling applies on Table summary as well and the issue  reproduced  at our end. We will validate and update you the details on December 31,2019.  
  
We appreciate your patience until then.  
 
Regards, 
Saravanan A. 



SA Saravanan Ayyanar Syncfusion Team December 31, 2019 12:26 PM UTC

Hi Jean-Marc, 
 
You can achieve your requirement by using Converter for each property in ControlTemplate. Please refer the below code snippet, 
 
<Window.Resources> 
        <local:BackColorConverter x:Key="backColorConverter"/> 
        <local:BorderColorConverter x:Key="borderColorConverter"/> 
        <local:BorderThicknessConverter x:Key="borderThicknessConverter"/> 
        <local:TextConverter x:Key="textConverter"/> 
        <Style TargetType="syncfusion:GridRowHeaderCell"> 
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate TargetType="syncfusion:GridRowHeaderCell"> 
                        <Border x:Name="PART_RowHeaderCellBorder"  
                        Background="{Binding Converter={StaticResource backColorConverter}}"   
                        BorderBrush="{Binding Converter={StaticResource borderColorConverter}}" 
                        BorderThickness="{Binding Converter={StaticResource borderThicknessConverter}}"> 
                            <Grid> 
                                <TextBlock HorizontalAlignment="Center" 
                                    VerticalAlignment="Center"                                     
                                    TextAlignment="Center" > 
                                    <TextBlock.Text> 
                                        <MultiBinding Converter="{StaticResource textConverter}"> 
                                            <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=syncfusion:SfDataGrid}" /> 
                                            <Binding Path="RowIndex" RelativeSource="{RelativeSource Mode=TemplatedParent}" /> 
                                        </MultiBinding> 
                                    </TextBlock.Text> 
                                </TextBlock> 
                            </Grid> 
                        </Border> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
    </Window.Resources> 
 
Please refer the below sample link, 
 
 
Screenshot: 
 
 
Please let us know, if you require further assistance on this.  
 
Regards, 
Saravanan A. 


Loader.
Live Chat Icon For mobile
Up arrow icon