Category / Section
How to have the Copy and Fill series of the excel behavior in GridDataBoundGrid?
1 min read
The GridDataBoundGridControl can have the copy/fill series like Excel. The copy series is used to copy the content of the current cell to the entire selection whereas the fill series is used to fill the selection with the increment of the current cell.
An ExcelSelectionMarkerMouseController helper class that implements the behavior of `Copy/Fill` series in the GridDataBoundGridControl. This class is available in the `Syncfusion.GridHelperClasses.Windows` assembly.
Note
To enable this feature, the ExcelLikeCurrentCell property has to be enabled for GridControl.
C#
//To set the excel like selection frame this.gridDataBoundGrid1.ExcelLikeSelectionFrame=true; //Set the Excel like current cell this.gridDataBoundGrid1.ExcelLikeCurrentCell = true; //Add the selection marker to the GridDataBoundGrid this.excelMarker = new ExcelSelectionMarkerMouseController(this.gridDataBoundGrid1); this.gridDataBoundGrid1.MouseControllerDispatcher.Add(excelMarker);
VB
'To set the excel like selection frame Me.gridDataBoundGrid1.ExcelLikeSelectionFrame = True 'Set the Excel like current cell Me.gridDataBoundGrid1.ExcelLikeCurrentCell = True 'Add the selection marker to the GridDataBoundGrid Dim excelMarker As New ExcelSelectionMarkerMouseController(Me.gridDataBoundGrid1) Me.gridDataBoundGrid1.MouseControllerDispatcher.Add(excelMarker)
Screenshot