Setting the Selected property of an object causes it to become selected. This property can also be used to determine whether the object has been selected.
Depending on the settings of the selection style property that applies to this object (SelectTypeCell) and maximum selection property (MaxSelectedCells) changing the value of the Selected property may affect the selection of other objects within the band or the control.
For example, if SelectTypeRow is set to 2 (SelectTypeSingle) so that only one row may be selected at a time, when you set the Selected property of an UltraGridRow object to True, the Selected properies of all other UltraGridRow objects will be set to False. As another example, if you have set the MaxSelectedRows property to 3, then attempt to set the Selected property to True for four rows, a run-time error will occur when you set the Selected property to True for the fourth row.
When an object is selected or deselected, the BeforeSelectChange event is generated.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Button100_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button100.Click Dim cell As UltraGridCell = Me.UltraGrid1.Rows(0).Cells(0) ' Toggle the selected status of the row. cell.Selected = Not cell.Selected End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button100_Click(object sender, System.EventArgs e) { UltraGridCell cell = this.ultraGrid1.Rows[0].Cells[0]; // Toggle the selected status of the row. cell.Selected = !cell.Selected; }
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