Home Forums WPF controls Xceed DataGrid for WPF How to find the row numbers

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23293 |

    Hi

    Plz let me know about how to find out the row numbers of a grid.

    Imported from legacy forums. Posted by Satheesh (had 3977 views)

    Xceed Support
    Member
    Post count: 5658

    The DataGridVirtualizingPanel.ItemIndex attached property will give you the index of the item. You can refer to the <a href=”http://doc.xcd/XceedWpfDataGrid/Styles.html”>Alternating data-row styles</a> example in the Styles topic for a example of how it works.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 296 views)

    User (Old forums)
    Member
    Post count: 23064

    Where has the IndexToOddConverter example gone to …it seems to have been taken out of the Documentation (was in the Styles section) ?

    Cheers,

    Dezzz.

    Imported from legacy forums. Posted by Desmond (had 316 views)

    Xceed Support
    Member
    Post count: 5658

    The IndexToOddConverter is now part of the product and can be found in the Xceed.Wpf.DataGrid.Converters namespace.

    Would you have preferred that it stayed in the documentation as well?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 313 views)

    User (Old forums)
    Member
    Post count: 23064

    Well, an example of how it is used is I believe what most folk can relate to – whether it’s in the Namespace area or the main Documentation.

    Cheers,

    Dezzz.

    Imported from legacy forums. Posted by Desmond (had 447 views)

    Xceed Support
    Member
    Post count: 5658

    The example demonstrates how use it as a resource. The converter is assigned to the Converter property of the DataTrigger’s Binding.

    <code>
    <Grid xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid”&gt;
    <Grid.Resources>
    <xcdg:IndexToOddConverter x:Key=”rowIndexConverter”/>
    <Style TargetType=”{x:Type xcdg:DataRow}”>
    <Style.Triggers>
    <DataTrigger Binding=”{Binding RelativeSource={RelativeSource Self},
    Path=(xcdg:DataGridVirtualizingPanel.ItemIndex),
    Converter={StaticResource rowIndexConverter}}”
    Value=”True”>
    <Setter Property=”Background”>
    <Setter.Value>
    <SolidColorBrush Color=”LightGray”
    Opacity=”0.1″/>
    </Setter.Value>
    </Setter>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    <xcdg:DataGridCollectionViewSource x:Key=”cvs_orders”
    Source=”{Binding Source={x:Static Application.Current},
    Path=Orders}”/>
    </Grid.Resources>
    <xcdg:DataGridControl x:Name=”OrdersGrid”
    ItemsSource=”{Binding Source={StaticResource cvs_orders}}”>
    </xcdg:DataGridControl>
    </Grid>
    </code>

    Imported from legacy forums. Posted by Jenny [Xceed] (had 5138 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.