We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ColWidths

Thread ID:

Created:

Updated:

Platform:

Replies:

10464 Feb 3,2004 06:34 AM Feb 4,2004 09:07 AM Windows Forms 5
loading
Tags: GridControl
Emil Damian
Asked On February 3, 2004 06:34 AM

Why cannot change the width of a column at design time?

Administrator [Syncfusion]
Replied On 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.

Marco Ensing
Replied On February 3, 2004 08:23 PM

Clay, 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. Marco

Administrator [Syncfusion]
Replied On 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. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=3918

Marco Ensing
Replied On February 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. Marco

Administrator [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;