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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid row header cell styling applies on Table summary as well

Thread ID:

Created:

Updated:

Platform:

Replies:

150214 Dec 26,2019 02:43 PM UTC Dec 31,2019 12:26 PM UTC WPF 2
loading
Tags: SfDataGrid
JMKAL
Asked On December 26, 2019 02:43 PM UTC

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

Saravanan Ayyanar [Syncfusion]
Replied On 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. 


Saravanan Ayyanar [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon