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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to make Columns Resizable

Thread ID:

Created:

Updated:

Platform:

Replies:

31021 Jun 29,2005 06:04 AM UTC Jun 30,2005 06:14 AM UTC WinForms 4
loading
Tags: GridControl
Jitendra
Asked On June 29, 2005 06:04 AM UTC

Hi, 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? Thanks, Jitendra.

Administrator [Syncfusion]
Replied On June 29, 2005 07:23 AM UTC

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.

Jitendra
Replied On June 29, 2005 12:39 PM UTC

Hi clay, 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? Thanks, Jitendra

Administrator [Syncfusion]
Replied On June 29, 2005 02:37 PM UTC

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] = ?????   
}

Jitendra
Replied On June 30, 2005 06:14 AM UTC

Hi Caly, This works fine. Thanks for the support. Regards, Jitendra.

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.

Warning Icon 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.Close Icon

;