Xceed Toolkit Plus for WPF v5.0 Documentation
Xceed.Wpf.DataGrid Assembly / Xceed.Wpf.DataGrid Namespace / RowSelector Class
Members Example


In This Topic
    RowSelector Class
    In This Topic
    Represents a control used to select a row.
    Syntax
    'Declaration
     
    <TemplatePartAttribute(Name="PART_RowResizerThumb", Type=System.Windows.Controls.Primitives.Thumb)>
    <DefaultPropertyAttribute("Content")>
    <ContentPropertyAttribute("Content")>
    <LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)>
    <StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
    <XmlLangPropertyAttribute("Language")>
    <UsableDuringInitializationAttribute(True)>
    <RuntimeNamePropertyAttribute("Name")>
    <UidPropertyAttribute("Uid")>
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class RowSelector 
       Inherits System.Windows.Controls.ContentControl
    'Usage
     
    Dim instance As RowSelector
    [TemplatePart(Name="PART_RowResizerThumb", Type=System.Windows.Controls.Primitives.Thumb)]
    [DefaultProperty("Content")]
    [ContentProperty("Content")]
    [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)]
    [StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
    [XmlLangProperty("Language")]
    [UsableDuringInitialization(true)]
    [RuntimeNameProperty("Name")]
    [UidProperty("Uid")]
    [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
    [NameScopeProperty("NameScope", System.Windows.NameScope)]
    public class RowSelector : System.Windows.Controls.ContentControl 
    Example
    All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
    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 RowSelector.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:RowSelector.RowSelectorStyle"
                  Value="{StaticResource itemIndexSelectorStyle}" />
        </Style>
      </Grid.Resources>
    
      <xcdg:DataGridControl x:Name="OrdersGrid"
                                ItemsSource="{Binding Source={StaticResource cvs_orders}}" />
    </Grid>
    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Media.Visual
                System.Windows.UIElement
                   System.Windows.FrameworkElement
                      System.Windows.Controls.Control
                         System.Windows.Controls.ContentControl
                            Xceed.Wpf.DataGrid.RowSelector

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also

    Reference

    RowSelector Members
    Xceed.Wpf.DataGrid Namespace

    DataGrid Fundamentals

    Other_Classes.html