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.
Unfortunately, activation email could not send to your email. Please try again.

Set RowIndex

Thread ID:

Created:

Updated:

Platform:

Replies:

123785 Apr 21,2016 03:02 AM Apr 22,2016 12:23 AM WPF 1
loading
Tags: SfDataGrid
ray
Asked On April 21, 2016 03:02 AM

I want add rowindex with every sfdatagrid in my app like below.

  <Application.Resources>

 

        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>

                             <ResourceDictionary Source="pack://application:,,,/Some;component/Styles/Accents/Blue.xaml" />

            </ResourceDictionary.MergedDictionaries>

            <Style TargetType="Syncfusion:GridRowHeaderCell">

                <Setter Property="Template">

                    <Setter.Value>

                        <ControlTemplate TargetType="Syncfusion:GridRowHeaderCell">

                            <Border x:Name="PART_RowHeaderCellBorder"

                        Background="White"

                        BorderBrush="{TemplateBinding BorderBrush}"

                        BorderThickness="{TemplateBinding BorderThickness}">

                                <Grid>

                                    <!--RowIndex is displayed here -->

                                    <TextBlock

                                    Text="{Binding RowIndex,

                                    RelativeSource={RelativeSource TemplatedParent}}"

                                    TextAlignment="Center" />

                                </Grid>

                            </Border>

                        </ControlTemplate>

                    </Setter.Value>

                </Setter>

            </Style>

        </ResourceDictionary>

    </Application.Resources>

But it's not work...... 


Jai Ganesh S [Syncfusion]
Replied On April 22, 2016 12:23 AM

Hi Ray,
We have prepared the sample by using your code snippet but the RowIndex is displayed in RowHeader as expected.
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.

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.

;