Articles in this section

How to prevent resizing a specific column in WinForms GridControl?

Resizing columns event


In WinForms GridControl, you can resize the columns by using the ResizingColumns event and revoke the resizing of a specific column.

//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;
}
'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:

C#: Prevent_column resizing

VB: Prevent_column resizing

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied