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.
Up arrow icon