Class GridRowHeaderCell
Represents a class that provides common functionalities of RowHeaderCells in SfDataGrid.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.DataGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class GridRowHeaderCell : GridCell, IDisposable
Remarks
The GridRowHeaderCell is the row header cell template part used by the
GridRowHeaderCellRenderer to display row
indicators in SfDataGrid. It extends GridCell and provides the row index
for numbering rows (similar to Excel), supports displaying row validation error
messages as a tool tip, and exposes attached properties used by the WPF platform to
render the row selection highlight and selection border.
Constructors
GridRowHeaderCell()
Initializes a new instance of the GridRowHeaderCell class.
Declaration
public GridRowHeaderCell()
Remarks
Sets the Microsoft.UI.Xaml.Controls.Control.DefaultStyleKey to the type of
the GridRowHeaderCell so that the default style from
Generic.xaml is applied, and marks the cell as not focusable by setting
Microsoft.UI.Xaml.UIElement.IsTabStop to false.
Fields
RowErrorMessageProperty
Identifies the RowErrorMessage dependency property.
Declaration
public static readonly DependencyProperty RowErrorMessageProperty
Field Value
| Type |
|---|
| Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the RowErrorMessage dependency property.
RowIndexProperty
Identifies the RowIndex dependency property.
Declaration
public static readonly DependencyProperty RowIndexProperty
Field Value
| Type |
|---|
| Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the RowIndex dependency property.
Properties
RowErrorMessage
Gets or sets the row validation error message that is displayed as a tool tip when the user hovers over the GridRowHeaderCell.
Declaration
public string RowErrorMessage { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A System.String that contains the row validation error message. The default value is System.String.Empty. |
RowIndex
Gets or sets the row index of the GridRowHeaderCell.
Declaration
public int RowIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | An System.Int32 that represents the zero-based index of the row in the view.
The default value is |
Remarks
The row index is used by the SfDataGrid to number the row similar to the row headers shown in Microsoft Excel. The value is automatically updated when the row is scrolled, sorted, filtered or grouped.
Methods
ApplyVisualState()
Applies the visual state for the GridRowHeaderCell.
Declaration
public void ApplyVisualState()
Remarks
Inspects the internal Syncfusion.UI.Xaml.DataGrid.GridRowHeaderCell.State property and uses
Microsoft.UI.Xaml.VisualStateManager to transition the row header
to the corresponding visual state. The supported
states are Normal, CurrentRow, EditingRow, Error,
Error_CurrentRow, AddNewRow, and FilterRow.
OnApplyTemplate()
Invoked to apply the control template for the GridRowHeaderCell.
Declaration
protected override void OnApplyTemplate()
Overrides
Remarks
Applies the current visual state by calling ApplyVisualState(), then updates the grid-cell visual states for the current Syncfusion.UI.Xaml.DataGrid.GridCell.GridCellRegion. On the WPF platform, the event handlers that were previously wired to the cell are detached and rewired to the new template parts.
OnCreateAutomationPeer()
Returns a class-specific AutomationPeer Implementations for the Microsoft UI Automation infrastrucutre.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
| Type | Description |
|---|---|
| Microsoft.UI.Xaml.Automation.Peers.AutomationPeer | The class-specific AutomationPeer subclass. |
Overrides
OnDoubleTapped(DoubleTappedRoutedEventArgs)
Called before the Microsoft.UI.Xaml.UIElement.DoubleTapped event occurs.
Declaration
protected override void OnDoubleTapped(DoubleTappedRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs instance containing the event data. |
Overrides
Remarks
Marks the double-tapped event as handled so that the double-tap does not propagate to the underlying row and trigger edit mode for the row header.
OnTapped(TappedRoutedEventArgs)
Called before the Microsoft.UI.Xaml.UIElement.Tapped event occurs.
Declaration
protected override void OnTapped(TappedRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UI.Xaml.Input.TappedRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.TappedRoutedEventArgs instance containing the event data. |
Overrides
Remarks
Marks the tapped event as handled so that the tap does not bubble up to the parent SfDataGrid and inadvertently change the current cell selection while interacting with the row header.