Version

SelectedRow Property

Gets or sets the currently selected row
Syntax
'Declaration
 
Public Property SelectedRow As UltraGridRow
public UltraGridRow SelectedRow {get; set;}
Remarks

In an UltraCombo control, this property determines the currently selected row.

Since an UltraDropDown control services many grid cells at once, this property should generally not be used for the UltraDropDown. Use the UltraGridCell.Value property of the UltraGridCell instead.

The SelectedRow, Value, and properties are tightly linked together. Changing one will change the others (except in some cases where rows have duplicate values).

Example
Following code prints out the index of the current selected row of an UltraCombo. SelectedRow is the row that was selected from the drop down. NOTE: If embedding UltraCombo or UltraDropDown inside a UltraGrid (as a value-list), SelectedRow will not return the selected row of a cell in the UltraGrid. It will only return the row that was selected from the standalone UltraCombo on the form.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click 

      ' Get the selected row.
      Dim row As UltraGridRow = Me.ultraCombo1.SelectedRow

      If Not row Is Nothing Then
          ' Print out the index of the selected row.
          Debug.WriteLine("Current selected row index = " & row.Index)
      Else
          ' If SelectedRow is null, then currently there is no row selected.
          Debug.WriteLine("No row currently selected.")
      End If

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button5_Click(object sender, System.EventArgs e)
{

	// Get the selected row.
	UltraGridRow row = this.ultraCombo1.SelectedRow;

	if ( row != null )
	{
		// Print out the index of the selected row.
		Debug.WriteLine( "Current selected row index = " + row.Index );
	}
	else
	{
		// If SelectedRow is null, then currently there is no row selected.
		Debug.WriteLine( "No row currently selected." );
	}

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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