ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.GroupColMove Event

Occurs whenever a column is moved into or out of the grouping area.

[Visual Basic]

Public Event GroupColMove As GroupColMoveEventHandler

[C#]

public event GroupColMoveEventHandler GroupColMove

[Delphi]

public property GroupColMove: GroupColMoveEventHandler read remove_GroupColMove write add_GroupColMove;

Remarks

The ColMoveEventArgs.Position property ranges from 0, which denotes the left edge, to the total number of columns, which denotes the right edge. A position of -1 is used to indicate that a column is being moved from the grouping area back to the grid.

To determine which column is being moved, use the Item method.

If the ColMoveEventArgs.Cancel property is set to True, no movement occurs. Selected columns always remain selected, regardless of the ColMoveEventArgs.Cancel setting.

See Column Grouping for more information.

Example

The following code uses GroupColMove event to automatically expand all groups after the user drags a column in the grouping area:

·      Visual Basic

       Private Sub C1TrueDBGrid1_GroupColMove(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.GroupColMoveEventArgs) Handles C1TrueDBGrid1.GroupColMove

           Dim col As Integer = e.ColIndex

           If col >= 0 Then

               Me.C1TrueDBGrid1.Columns(col - 1).GroupInfo.OutlineMode = C1.Win.C1TrueDBGrid.OutlineModeEnum.StartExpanded

           End If

       End Sub

·      C#

       private void c1TrueDBGrid1_GroupColMove(object sender, C1.Win.C1TrueDBGrid.GroupColMoveEventArgs e)

       {

           int col = e.ColIndex;

           if (col >= 0)

           {

               this.c1TrueDBGrid1.Columns(col - 1).GroupInfo.OutlineMode = C1.Win.C1TrueDBGrid.OutlineModeEnum.StartExpanded;

           }

       }

·      Delphi

       procedure C1TrueDBGrid1_GroupColMove(sender: System.Object; e: C1.Win.C1TrueDBGrid.GroupColMoveEventArgs);

       var

         col : Integer;

       begin

         col := e.ColIndex;

         if (col >= 0) then

           Self.C1TrueDBGrid1.Columns((col - 1)).GroupInfo.OutlineMode := C1.Win.C1TrueDBGrid.OutlineModeEnum.StartExpanded;

       end;

See Also

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


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