Touch Support in Windows Forms GridGrouping control

21 Jan 20253 minutes to read

GridGroupingControl provides the swipe scrolling, panning, zooming and touch selection (bubble selection) touch supports. The touch support for grid can be enabled by setting the EnableTouchMode property to true. This will enable the grid to support the swiping, panning, touch selection (bubble selection) and zooming. The default value of EnableTouchMode property is false.

//Enable the touch mode
this.gridGroupingControl1.EnableTouchMode = true;
'Enable the touch mode
Me.gridGroupingControl1.EnableTouchMode = True

Touch Swiping

GridGroupingControl provides the swipe scrolling support in both horizontal and vertical directions.
DataGrid_img1

NOTE

To have the proper horizontal and vertical pixel touch scrolling, the HScrollPixel and VScrollPixel properties should be set to true. By default the HScrollPixel and VScrollPixel properties is true.

Touch Zooming

The GridGroupingControl allows to perform the touch zoom in or out operations to the entire grid by initialize the ZoomGroupingGrid class where the constructor takes a parameter as a GridGroupingControl object.
To have this touch zooming support in grid, the GridHelperClasses.Windows assembly needs to be added into the assembly reference.

// Initialize the Zooming to GridGroupingControl   
ZoomGroupingGrid zoom = new ZoomGroupingGrid(this.gridGroupingControl1);
'Initialize the Zooming to GridGroupingControl   
Dim zoom As New ZoomGroupingGrid(Me.gridGroupingControl1)

DataGrid_img2

NOTE

The GridGroupingControl does not allow to perform the touch zoom in or out operations when current cell is in editing mode.

Touch Selection

The touch selection support as like Excel can be enabled by setting the EnableTouchMode property to true and also the Excel-like selection frame and Excel-like current cell options needs to be enabled to enable the touch selection support.
To enable excel like selection frame in the grid, the ExcelLikeSelectionFrame property can be used. And to have the Excel-Like current cell in the grid, set the ExcelLikeCurrentCell to true.

//Enable the Excel-like selection frame.
this.gridGroupingControl1.TableModel.Options.ExcelLikeSelectionFrame = true;

//Enable the Excel-like current cell.
this.gridGroupingControl1.TableModel.Options.ExcelLikeCurrentCell = true;
'Enable the Excel-like selection frame.
Me.gridGroupingControl1.TableModel.Options.ExcelLikeSelectionFrame = True

'Enable the Excel-like current cell.
Me.gridGroupingControl1.TableModel.Options.ExcelLikeCurrentCell = True

DataGrid_img3

NOTE

GridGroupingControl does not allow to perform the touch selection operation in 2003 Excel like selection frame. And also grid does not allow to perform the touch selection operations when current cell is in editing mode. This can be avoid by setting the ActivateCurrentCellBehavior property to GridCellActivateAction.DblClickOnCell or GridCellActivateAction .None option.

Disabling the Touch Selection

The touch selection can be disabled by setting the ShowTouchIndicator property to false. The default value of ShowTouchIndicator property is true.

//Disable the touch indicator
this.gridGroupingControl1.TableControl.ShowTouchIndicator = false;
'Disable the touch indicator
Me.gridGroupingControl1.TableControl.ShowTouchIndicator = False

DataGrid_img4