ADAdministrator Syncfusion Team February 3, 2004 08:03 AM
You can for a GridControl, but cannot for a GridDataBoundGrid. The GridBoundColumns which you have access to at design time for a GridDataBoundGrid, do not have a Width property associated with them.
You can derive GridBoundColumn and add a Width property to it.
Here is a sample that adds such a property, the CustomGridBoundColumn.Width, that can be used both design time and runtime as long as it is not zero. It has a Northwind datasource set in the designer, so you may have to tweak that to get it to run on your system.
It does so by listening to the Model.QueryColWidths event, and if there is a non zero width value in a column, it provides it in this event. Subscribing to the event is a little problematic in that you cannot do it in the grid''s constructor as the Model is not fully functional at that point. So, this sample uses an OnPaint override to subcribe with a flag set to to repeatedly subscribing. There may be a better place to put this, but this seems to work.
MEMarco EnsingFebruary 3, 2004 08:23 PM
Thanks for the example. Is this going to be part of the 2.* release ?
What would be really nice if the column width would persist state. Something similar as the docking control.
I tried to set the QueryColWidth() but then the user can not re-size the columns later on.
Or the values will not be restored the next time.
ADAdministrator Syncfusion Team February 4, 2004 01:30 AM
In the 2.0 GridGroupingControl, you can persist look and feel elements like column width, but the GridBoundColumn used by the GridDataBoundGrid has not been changed yet to include a width property.
There are samples in this forum thread that show how you can persist your user''s column order and size at runtime.
MEMarco EnsingFebruary 4, 2004 07:32 AM
Tnaks for your reply.
Problem with the GridGroupControl is that it is too slow. Originally I made an example with the GridGroupControl, and now I''m changing it to the GridControl. (I know I loose some features)
I also ran the syncfusion GripGrouping examples and when I want to switch from the first record to the last record, it takes too long.
The gridDataBoundGrid seems to be much more responsive to user interactions. If I''m not mistaken the GridGroupControl is a further specialization of the GridControl.
Wonder what other peoples perception is on this issue.
ADAdministrator Syncfusion Team February 4, 2004 09:07 AM
The current emphasis for the GridGroupingControl has been the feature set. We have yet to try to optimize it for performance, but that is coming.