AD
Administrator
Syncfusion Team
June 21, 2006 05:25 PM UTC
Hi Colin,
Regarding the Question 1:
To resize the width of the column to fit the size of the control , you need to call the ResizeToFit method . Here is a code snippet.
gridControl1.RowHeights.ResizeToFit(GridRangeInfo.Cell(2, 4));
gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Cell(2, 4));
Note : this method only applicable for usercontrol celltype. If the celltype is control cell type , you need to caluclate the width of the control and assign the colWidth explictly.
Regardig the Question 2:
You need to handle the ResizingColumns event for preventing the resizing of the column in a grid. Here is a code snippet.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
if(e.Columns.Left == 2)
e.Cancel = true;
}
Let me know if this helps.
Best Regards,
Haneef
CB
Colin Bolton
June 22, 2006 08:14 AM UTC
Thanks Haneef, I think this does the job.