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. Image for the cookie policy date

Column AutoSize Update delayed

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?

BR
Christoph

I'm using Syncfusion 5.1.1.0

grid21.zip

2 Replies

HA haneefm Syncfusion Team June 27, 2007 06:06 PM UTC

Hi Christoph,

Below is a forum thread that discuss with the similar issue.
http://www.syncfusion.com/support/Forums/message.aspx?MessageID=60950

Best regards,
Haneef


CG Christoph Gasser June 28, 2007 09:53 AM UTC

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!

Loader.
Live Chat Icon For mobile
Up arrow icon