Occurs whenever the user selected a different range of rows or columns.
[Visual Basic]
Public Event SelChange As CancelEventHandler
[C#]
public event CancelEventHandler SelChange
[Delphi]
public property SelChange: CancelEventHandler read remove_SelChange write add_SelChange;
Remarks
This event is triggered under several circumstances:
· When the user selects a single row by clicking its record selector.
· When the user adds a row to the list of selected rows by clicking its record selector while holding down the CTRL key.
· When the user selects a single column by clicking its header.
· When the user changes the range of selected columns by dragging to an adjacent column within the header row.
· When the user extends the range of selected columns by holding down the SHIFT key and clicking an unselected column header.
· When the user clears the current row or column selection by clicking an individual cell, in which case this event precedes RowColChange.
The current range of selected columns is provided by the SelectedRows and SelectedCols properties. The bookmarks of the selected rows are available in the SelectedRowCollection. Within this event procedure, these properties and collections reflect the user's pending selection(s).
If the event procedure sets the CancelEventArgs.Cancel property to True, the previous row and column selections (if any) are restored, and the aforementioned properties revert to their previous values.
This event is only triggered by user interaction with the grid. It cannot be triggered by code.
Note: When the user selects a column, any row selections are cleared. Similarly, when the user selects a row, any column selections are cleared.
Example
The following code shows how to set focus to the grid when the user clicks the record selector column. This allows the record to be deleted.
Private Sub C1TrueDBGrid1_SelChange(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.CancelEventArgs) Handles C1TrueDBGrid1.SelChange
Me.C1TrueDBGrid1.Focus()
End Sub
· C#
private void c1TrueDBGrid1_SelChange(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)
{
this.c1TrueDBGrid1.Focus();
}
· Delphi
procedure TWinForm.C1TrueDBGrid1_SelChange(sender: System.Object; e: C1.Win.C1TrueDBGrid.CancelEventArgs);
begin
Self.C1TrueDBGrid1.Focus;
end;
See Deleting a Record for more information.
See Also
C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |