how to use gridcontrol ColumnSizer Property

Hi,

I'm using grid control in my project. Column widths of Grid Control should be adjusted with respect to the cell and header content.
For this I tried to use as follows and end up with compilation errors.
gridControl1 is my object.

gridControl1.ColumnSizer = Syncfusion.Windows.Controls.Grid.GridControlLengthUnitType.SizeToCells;

and also i tried as below.

gridControl1.Model.Options.ColumnSizer = Syncfusion.Windows.Controls.Grid.GridControlLengthUnitType.SizeToCells;

This is also ends up with error.
Am I missing something..? waiting for the reply..!
Thanks in Advance..!
-Ramm


1 Reply

RV Ramesh V Syncfusion Team August 23, 2011 08:42 AM UTC




Hi Ramm,

Thanks for your interest in syncfusion products.

We have analyzed your requirements and you can set ColumnSizer in grid loaded event as like the following and also this is working fine in our side.

Code Snippet[C#]:

void grid_Loaded(object sender, RoutedEventArgs e)
{
grid.Model.Options.ColumnSizer = GridControlLengthUnitType.Auto;
}

Please let us know if this helps.

Regards,
Ramesh


Loader.
Up arrow icon