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.

Reset Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

578 Jul 10,2002 12:03 PM Jul 11,2002 10:25 AM Windows Forms 3
loading
Tags: GridControl
Sam Horton
Asked On July 10, 2002 12:03 PM

I have Grid.GridControl in which I've poplulated values, set formats etc. I'd like to reset the grid with entirely new values and different formats programmatically. I've tried a few things and could dispose of the control and add a new one, but is there a way to cleanly clear the grid and re-use the object that I've missed?

Stefan Hoenig [Syncfusion]
Replied On July 10, 2002 08:12 PM

> I have Grid.GridControl in which I've poplulated values, set formats etc. > > I'd like to reset the grid with entirely new values and different formats programmatically. > > I've tried a few things and could dispose of the control and add a new one, but is there a way to cleanly clear the grid and re-use the object that I've missed? > One easy way is to set row and column count to zero, as for example: gridControl1.RowCount = 0; gridControl1.ColCount = 0; After that set new row and column count and populate the grid. - Or - You simply attach a new data object: gridControl1.Data = new Syncfusion.Windows.Forms.Grid.GridData(); gridControl1.UpdateScrollBars(); Stefan Hoenig

Sam Horton
Replied On July 11, 2002 06:07 AM

> > I have Grid.GridControl in which I've poplulated values, set formats etc. > > > > I'd like to reset the grid with entirely new values and different formats programmatically. > > > > I've tried a few things and could dispose of the control and add a new one, but is there a way to cleanly clear the grid and re-use the object that I've missed? > > > > One easy way is to set row and column count to zero, as for example: > > gridControl1.RowCount = 0; > gridControl1.ColCount = 0; > > After that set new row and column count and populate the grid. > > - Or - > > You simply attach a new data object: > > gridControl1.Data = new Syncfusion.Windows.Forms.Grid.GridData(); > gridControl1.UpdateScrollBars(); > > Stefan Hoenig Thank you Stefan! I ended up having to clear a few things specific to the app as well to get the right behavior: Me.Grid.ReadOnly = False Me.Grid.Cols.RestoreFrozen() Me.Grid.ColCount = 0 Me.Grid.RowCount = 0 . . [re-populate] . Me.Grid.Refresh() What task does the command gridControl1.UpdateScrollBars() perform which helps the process? I'm curious....

Stefan Hoenig [Syncfusion]
Replied On July 11, 2002 10:25 AM

It just updates the scroll range information for the scrollbars and hides/shows scrollbars if necessary. This is necessary because when the data object is assigned, the view isnot refreshed and scrollbars would be out of sync. Stefan

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.

;