Category / Section
How to disable the resizing rows in WinForms GridControl?
1 min read
Resizing the rows
The grid control has a row/column resizing option upon keeping the cursor near the row/column splitter by default. In order to disable the resizing option, you can use ResizingRows event.
C#
//Event handler this.grid.ResizingRows += grid_ResizingRows; void grid_ResizingRows(object sender, GridResizingRowsEventArgs e) { //To disable resizing of rows. e.Cancel = true; }
VB
'Event handler Me.grid.ResizingRows += grid_ResizingRows Private Sub grid_ResizingRows(ByVal sender As Object, ByVal e As GridResizingRowsEventArgs) 'To disable resizing of rows. e.Cancel = True End Sub
Samples:
C#: ResizingRows_CS
VB: ResizingRows_VB