Version

Controlling the Tab Order of Cells

The TabIndex property of the column allows you to control the order in which WinGrid™ traverses the cells of a row when the user presses the Tab key. The default value of the TabIndex property is -1. -1 specifies that the default tab order should be used. The WinGrid determines the the default tab order based on the locations of the cells, in the order from left to right and top to bottom. You typically set the TabIndex of columns to different values. The column with lower tab value will be traversed before the column with higher tab value. Also you typically set the TabIndex on all the visible columns because if you leave the TabIndex to its default value of -1 then it will be the last in the tab order. Note that multiple columns can have the same TabIndex value in which case their order is determined based on their locations.

Code Snippet

The following code sets the TabIndex property on three columns. The following code will cause the Tab key to traverse Address, CompanyName, ContactName, Phone, and Region in order.

In Visual Basic:

Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, _
  ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) _
  Handles UltraGrid1.InitializeLayout
	Me.UltraGrid1.DisplayLayout.Bands(0).Columns("CompanyName").TabIndex = 0
	Me.UltraGrid1.DisplayLayout.Bands(0).Columns("ContactName").TabIndex = 1
	Me.UltraGrid1.DisplayLayout.Bands(0).Columns("Address").TabIndex = 2
	Me.UltraGrid1.DisplayLayout.Bands(0).Columns("Region").TabIndex = 3
	Me.UltraGrid1.DisplayLayout.Bands(0).Columns("Phone").TabIndex = 4
End Sub

In C#:

private void ultraGrid1_InitializeLayout(object sender,
  Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
	this.customersUltraGrid.DisplayLayout.Bands[0].Columns["CompanyName"].TabIndex = 0;
	this.customersUltraGrid.DisplayLayout.Bands[0].Columns["ContactName"].TabIndex = 1;
	this.customersUltraGrid.DisplayLayout.Bands[0].Columns["Address"].TabIndex = 2;
	this.customersUltraGrid.DisplayLayout.Bands[0].Columns["Region"].TabIndex = 3;
	this.customersUltraGrid.DisplayLayout.Bands[0].Columns["Phone"].TabIndex = 4;
}