I am using GridDataBoundGrid.Im using QueryColWidth Event to set Column Sizes.But Now I want to Resize the columns.Initially it must be appeared as specified in QueryColWidth event handler,then able to resize the columns.How to do this?
ADAdministrator Syncfusion Team June 29, 2005 02:23 AM
The simplest thing to do is not to use QueryColWidth. Instead, in Form.Load, set grid.AllowResizeToFit = false, and loop through grid.Model.ColWidths explicitly setting the col widths of each column using the same logic that you are using in your QueryColWidth handler. At the end of Form.Load, make sure you call grid.Model.ResetVolatileData.
In this way, your grid should be initially displayed as it was when you were using QueryColWidth, but your user would also be able to set the colwidths using the UI.
JIJitendraJune 29, 2005 07:39 AM
Can u tell me how to loop the columns and Set grid.Model.ColWidths.Its accepting GridModelRowColSizeIndexer.How to give this.Can u give me example code?
ADAdministrator Syncfusion Team June 29, 2005 09:37 AM
You can index grid.Model.ColWidths.
for(int col = 0; col <= grid.Model.ColCount; ++col)
//set the width you want for col somehow
grid.Model.ColWidths[col] = ?????
JIJitendraJune 30, 2005 01:14 AM
This works fine.
Thanks for the support.