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

how to specified specific columns width in ggc to be fixed and non-resizable

In the ggc, how do I specified specific columns width in the ggc to be fixed and non-resizable?

2 Replies

AD Administrator Syncfusion Team November 30, 2006 03:56 AM UTC

Hi James,

Use the GridColumnDescriptor.Width property to set the width of the column in a grid. And you need to subscribe the ResizingColumns event and set e.Cancel = true to handle it. Here is a code snippet to show this.

//Set the width of the first column to 200.
this.gridGroupingControl1.TableDescriptor.Columns[1].Width = 200;
this.gridGroupingControl1.TableControl.ResizingColumns +=new GridResizingColumnsEventHandler(TableControl_ResizingColumns);

private void TableControl_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
if( e.Columns.Right == 2)
e.Cancel = true;
}

Best Regards,
Haneef


JB James Blibo November 30, 2006 12:45 PM UTC

This works perfect! thanks!

Can I do the same for column dragging/moving. That is, I want to prevent specific columns from being moved

Loader.
Live Chat Icon For mobile
Up arrow icon