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.

Column AutoSize Update delayed

Thread ID:





63060 Jun 27,2007 12:04 PM Jun 28,2007 05:53 AM Windows Forms 2
Tags: GridControl
Christoph Gasser
Asked On June 27, 2007 12:04 PM

I've implemented a DataBoundGrid in my form and depending on a GridGroupControl the content in the DataBoundGrid changes. So far so good.

To allocate enough space for the content of each column in the DBG I'm using the AutoSize function.

//Resize all columns width to fit the content
this.gridDataBoundGrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, this.gridDataBoundGrid.Model.ColCount -1));

What happens now is, that whenever I change the content, the update of the grid "hangs behind". To explain what I mean, I've attached a short screen captured clip.

Any idea how to solve that?


I'm using Syncfusion


haneefm [Syncfusion]
Replied On June 27, 2007 02:06 PM

Hi Christoph,

Below is a forum thread that discuss with the similar issue.

Best regards,

Christoph Gasser
Replied On June 28, 2007 05:53 AM

Thank you for your reply. I do understand that this is a problem when you have a lot of cells in your grid. But at the moment I've 4 rows and 7 columns. That makes 28 cells in total and I do have that problem.

But after fiddeling around a found out what the problem was: The GridRangeInfo.Cols index starts with 1 and not with 0. So instead of
this.gridDataBoundGrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, this.gridDataBoundGrid.Model.ColCount -1));

I#m using
this.gridDataBoundGrid.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(1, this.gridDataBoundGrid.Model.ColCount));

And everything's working perfectly fine!

Nevertheless, thank you for your support which is always perfect and a big help!


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.