| Visual Basic (Declaration) | |
|---|---|
Public Property RowSelectorNumberStyle As RowSelectorNumberStyle | |
| C# | |
|---|---|
public RowSelectorNumberStyle RowSelectorNumberStyle {get; set;} | |
The following code enables the row numbers feature.
| Visual Basic | Copy Code |
|---|---|
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout ' Set the RowSelectorNumberStyle to enable the row-numbers. e.Layout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.VisibleIndex ' You can control the appearance of the row numbers using the RowSelectorAppearance. e.Layout.Override.RowSelectorAppearance.ForeColor = Color.Blue e.Layout.Override.RowSelectorAppearance.FontData.Bold = DefaultableBoolean.True ' You can explicitly set the width of the row selectors if the default one calculated ' by the UltraGrid is not enough. e.Layout.Override.RowSelectorWidth = 60 End Sub | |
| C# | Copy Code |
|---|---|
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void UltraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Set the RowSelectorNumberStyle to enable the row-numbers. e.Layout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.VisibleIndex; // You can control the appearance of the row numbers using the RowSelectorAppearance. e.Layout.Override.RowSelectorAppearance.ForeColor = Color.Blue; e.Layout.Override.RowSelectorAppearance.FontData.Bold = DefaultableBoolean.True; // You can explicitly set the width of the row selectors if the default one calculated // by the UltraGrid is not enough. e.Layout.Override.RowSelectorWidth = 60; } | |
The row numbers are 1 based. In other words the numbers displayed in the row selectors are not the actual index values but one plus the index value.
You can use the RowSelectorNumberStyle property to display row numbers in the row selectors. If this property is set to a value for displaying row numbers then the default widths of the row selectors is automatically enlarged to accomodate row numbers. You can explicitly specify the width of the row selectors using RowSelectorWidth property.