We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Column Header Width

Incident History: [Created on 11/23/2005 1:15:29 AM by: ] Product Version : 3.0.1.0 .NET Framework Version : 1.1 I am using the Grid and in that Grid I can increase or Decrease the headers Width by CLICKING AND DRAGGING the Headers . But I want that I Could Click and Drag that Header But Not beyond some measure . For Example I am using SyncfusionGrid.ColWidths().Item(1) = 65 The above piece of code will set the width of the Column to 65 . Now If I am reducing the Width at RUN TIME by Clicking and dragging it Should not Go Beyond 30 . I hope I am able to make the Question understood.Please send me a code snippet if there is the solution for the same .

1 Reply

AD Administrator Syncfusion Team November 23, 2005 09:11 AM UTC

You can use the grid.ResizingColumns event.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	if(e.Reason == GridResizeCellsReason.MouseMove && e.Width < 30)
	{
		e.Cancel = true;
	}
}
If you want to handle things differently depending upon the column, you would also have to check the e.Columns property to see what column(s) is being resized.

Loader.
Live Chat Icon For mobile
Up arrow icon