Occrus whenever a column header is clicked.
[Visual Basic]
Public Event HeadClick As ColEventHandler
[C#]
public event ColEventHandler HeadClick
[Delphi]
public property HeadClick: ColEventHandler read remove_HeadClick write add_HeadClick;
Example
The following example sorts the columns in the grid when the header is clicked on:
Private Sub C1TrueDBGrid1_HeadClick(ByVal sender As System.Object, ByVal e As C1.Win.C1TrueDBGrid.ColEventArgs) Handles C1TrueDBGrid1.HeadClick
' Get the display column that was clicked.
Dim dc As C1.Win.C1TrueDBGrid.C1DisplayColumn = Me.C1TrueDBGrid1.Splits(0).DisplayColumns(e.ColIndex)
' Add new sort order code here.
' Add code to build sort condition.
' Add code to sort it.
' Add code to save the sort state.
End Sub
· C#
private void c1TrueDBGrid1_HeadClick(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
{
// Get the display column that was clicked.
C1.Win.C1TrueDBGrid.C1DisplayColumn dc = this.c1TrueDBGrid1.Splits[0].DisplayColumns[e.ColIndex];
// Add new sort order code here.
{
}
// Add code to build sort condition.
// Add code to sort it.
// Add code to save the sort state.
}
· Delphi
procedure C1TrueDBGrid1_HeadClick(sender: System.Object; e: C1.Win.C1TrueDBGrid.ColEventArgs);
var
dc : C1.Win.C1TrueDBGrid.C1DisplayColumn;
begin
// Get the display column that was clicked.
dc := Self.c1TrueDBGrid1.Splits[0].DisplayColumns[e.ColIndex];
// Add new sort order code here.
// Add code to build sort condition.
// Add code to sort it.
// Add code to save the sort state.
end;
See Also
C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |