Version

Selected Property (UltraGridRow)

Property: gets/sets whether the row is selected.
Syntax
'Declaration
 
Public Overrides Property Selected As Boolean
public override bool Selected {get; set;}
Remarks

The UltraGrid maintains selected rows, cells and columns in Selected object. The Selected object exposes Selected.Rows, Selected.Cells and Selected.Columns properties that return selected rows, cells and columns respectively. When you set the Selected property of a row, that row gets added to the selected rows collection of the Selected object. You can also select a row by calling the SelectedRowsCollection.Add method of the selected rows collection.

NOTE: If you want to select a lot of rows at once then use the SelectedRowsCollection.AddRange method of the SelectedRowsCollection for greater efficiency.

Example
Following code shows how Selected property works. It toggles the selected state of the first row. Continuously clicking on this button will select and unselect the row.

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

  Private Sub Button101_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button101.Click

      Dim row As UltraGridRow = Me.UltraGrid1.Rows(0)

      ' Toggle the selected status of the row.
      row.Selected = Not row.Selected

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

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

	UltraGridRow row = this.ultraGrid1.Rows[0];

	// Toggle the selected status of the row.
	row.Selected = !row.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