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
SIGN IN To post a reply.
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.
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
-
JM JMKAL
- Dec 26, 2019 02:43 PM UTC
- Dec 31, 2019 12:26 PM UTC