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.

GDBG w/Hidden or zero-width columns (I'm confused)

Thread ID:





6351 Aug 10,2003 11:54 AM Aug 10,2003 07:01 PM Windows Forms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On August 10, 2003 11:54 AM

I have an application with two grids. One is non-daba-bound, the other is a GDBG bound to a DataSet. As the user moves around in the cells of the upper grid, I fetch different data-sets (with different column layouts) and rebind it to the GDBG using the following code: this.followerGrid.BeginUpdate ( ); this.followerGrid.DataSource = ds; this.followerGrid.DataMember = ds.Tables[0].TableName; this.followerGrid.Model.ColWidths.ResizeToFit (sfGrid.GridRangeInfo.Table(), sfGrid.GridResizeToFitOptions.IncludeHeaders | sfGrid.GridResizeToFitOptions.NoShrinkSize ); this.followerGrid.Invalidate ( ); this.followerGrid.EndUpdate ( ); For some reason, when the user shrinks a column width down to nothing, the GDBG seems to "remember" that and when I rebing the GDBG to a new DataSet, it doesn't display all the columns. I cannot figure out what to reset or clear to cause the GDBG to stop hiding/collapsing the size=zero column(s). I tried... this.followerGrid.GridBoundColumns.Clear(); ... prior to assigning the new dataset, but that didn't have any effect. Help?

Administrator [Syncfusion]
Replied On August 10, 2003 01:19 PM

After setting the datasource, try gridDataBoundGrid1.Model.ColWidths.ResetRange(0, this.gridDataBoundGrid1.Model.ColCount); gridDataBoundGrid1.Model.Cols.Hidden.ResetRange(0, this.gridDataBoundGrid1.Model.ColCount); gridDataBoundGrid1.Model.ResetVolatileData(); to see if this resets the resized columns and hidden columns.

Administrator [Syncfusion]
Replied On August 10, 2003 07:01 PM

That did the trick, as usual. Thanks again.


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.