Articles in this section
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:

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)
Please sign in to leave a comment
Access denied
Access denied