ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBDropdown.SelChange Event

Occurs when the user selects 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 C1TrueDBGrid.RowColChange.

The current range of selected columns is provided by the C1TrueDBGrid.SelectedRows and C1TrueDBGrid.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

You can prevent a column selection from occurring at run time by setting the CancelEventArgs.Cancel property to True:

·      Visual Basic

       Private Sub C1TrueDBDropdown1_SelChange(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.CancelEventArgs) Handles C1TrueDBDropdown1.SelChange

           e.Cancel = True

       End Sub

·      C#

       private void C1TrueDBDropdown1_SelChange(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)

       {

           e.Cancel = true;

       }

·      Delphi

       procedure TWinForm.C1TrueDBDropdown1_SelChange(sender: System.Object; e: C1.Win.C1TrueDBGrid.CancelEventArgs);

       begin

         e.Cancel := True;

       end;

See Also

C1TrueDBDropdown Class | C1TrueDBDropdown Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.