Category / Section
How to prevent resizing a specific column in WinForms GridControl?
1 min read
Resizingcolumns event
In GridControl, you can resize the columns by using ResizingColumns event and revoke the resizing of the specific columns.
C#
//Handles Resizing Columns event. void gridControl1_ResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs e) { //Disables column resizing for the third column from the right if (e.Columns.Right == 2) e.Cancel = true; }
VB
'Handles Resizing Columns event. Private Sub gridControl1_ResizingColumns(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs) 'Disables column resizing for the third column from the right If e.Columns.Right = 2 Then e.Cancel = True End If End Sub
Samples: