Hello
I'am using SfDataGrid with Master Details View. How to autonumerate only "main" rows? I don't want to involve
nested tables
rows in rows autonumeration . Is that possible?
I've set AutogenerateRelations to false, but that doesn't solve my problem.
I use style to autonumerate rows
and i get:
But i want to autonumerate only "main" rows and get
<syncfusion:SfDataGrid x:Name="dataGrid" AutoGenerateColumns="True" AutoGenerateRelations="False" ItemsSource="{Binding Employees}"> |
Nothing changed. Maybe the probelem is in style i use for set row number in header:
<Style TargetType="syncfusion:GridRowHeaderCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="syncfusion:GridRowHeaderCell">
<Border x:Name="PART_RowHeaderCellBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding RowIndex,RelativeSource={RelativeSource TemplatedParent}}"
TextAlignment="Center" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Your sample shows autonumerate all rows in datagrid. And style is responsible for this numeration. When you add Master Detail View, the detail View rows will be autonumerate as well. I need a solution for autonumerating only Master rows without Details rows :-) thus i thought it might be achieve by modyfying style which now affected all rows. Maybe exclude detail rows in the style code help to solve my problem