GrapeCity.Win.MultiRow Namespace > Cell Class : Selected Property |
<EditorBrowsableAttribute(EditorBrowsableState.Advanced)> <BrowsableAttribute(False)> <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> Public Property Selected As Boolean
[EditorBrowsable(EditorBrowsableState.Advanced)] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Selected {get; set;}
Exception | Description |
---|---|
System.InvalidOperationException | Sets the property at design time. -or- Sets the property to true when the Cell is not selectable. -or- Sets the property to true when the Scope is not CellScope.Row and the GcMultiRow.ViewMode is ViewMode.ListBox. |
void getSelectionInformationButton_Click(object sender, EventArgs e) { string info = null; // Get a specific cell's selection state. info = "First Cell's Selection State: " + gcMultiRow1[0, 0].Selected; info += "\r\n\r\n"; // Get a specific row's selection state. info += "First Row's Selection State: " + gcMultiRow1.Rows[0].Selected; info += "\r\n\r\n"; info += "Selected cells List:"; // Get all selected cells. foreach (Cell cell in this.gcMultiRow1.SelectedCells) { info += "\r\n"; info += "RowIndex: " + cell.RowIndex + ", CellIndex: " + cell.CellIndex; } info += "\r\n\r\n"; info += ("Selected rows List:"); // Get all selected rows. foreach (Row row in this.gcMultiRow1.SelectedRows) { info += "\r\n"; info += "RowIndex: " + row.Index; } MessageBox.Show(info); }
Private Sub getSelectionInformationButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles getSelectionInformationButton.Click Dim info As String = Nothing ' Get a specific cell's selection state. info = "First Cell's Selection State: " + gcMultiRow1(0, 0).Selected.ToString() info += vbCr & vbLf & vbCr & vbLf ' Get a specific row's selection state. info += "First Row's Selection State: " + gcMultiRow1.Rows(0).Selected.ToString() info += vbCr & vbLf & vbCr & vbLf info += "Selected cells List:" ' Get all selected cells. For Each cell As Cell In Me.gcMultiRow1.SelectedCells info += vbCr & vbLf info += "RowIndex: " + cell.RowIndex.ToString() + ", CellIndex: " + cell.CellIndex.ToString() Next info += vbCr & vbLf & vbCr & vbLf info += ("Selected rows List:") ' Get all selected rows. For Each row As Row In Me.gcMultiRow1.SelectedRows info += vbCr & vbLf info += "RowIndex: " + row.Index.ToString() Next MessageBox.Show(info) End Sub
Target Platforms: 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