Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Re: How do i create a rowNumber indicator?

  •  05-23-2008, 8:35 AM

    Re: How do i create a rowNumber indicator?

    The following example demonstrates how to display a row's visual index in its corresponding row selector by creating a style targeting the RowSelector type that displays the value of its ItemIndex property as its content. The style is then assigned to the RowSelectorPane.RowSelectorStyle attached property, which is set by the implicit DataRow style.

    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <Grid.Resources>
        <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                           Source="{Binding Source={x:Static Application.Current},
                                                            Path=Orders}" />

        <Style x:Key="itemIndexSelectorStyle"
               TargetType="{x:Type xcdg:RowSelector}">
          <Setter Property="Content"
                  Value="{Binding RelativeSource={RelativeSource Self}, Path=ItemIndex}"/>
        </Style>
        <Style TargetType="{x:Type xcdg:DataRow}">
          <Setter Property="xcdg:RowSelectorPane.RowSelectorStyle"
                  Value="{StaticResource itemIndexSelectorStyle}" />
        </Style>
      </Grid.Resources>

      <xcdg:DataGridControl x:Name="OrdersGrid"
                                ItemsSource="{Binding Source={StaticResource cvs_orders}}" />
    </Grid>


    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
View Complete Thread
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.