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
close icon

Grid.Binder in GDBG memory persistant?

I have a GDBG where I first retrieve a typed dataset from the db, add some columns manually that I need, and then finally bind it to the grid. After this I use Model.Cols.MoveRange() to move the columns around based on user settings. Now, my problem is that the first time I execute this code it works, but the second time it doesn''t because the Binder context seem to remember the columns an their "old" order. I have tried things like Model.ResetVolatileData() and Binder.InitializeColumns() without success. I even tried to call Binder.Dispose() still with the same result. Any ideas how I can initialize the grid to make it work just like the first time I execute the code?

1 Reply

AD Administrator Syncfusion Team November 14, 2005 09:06 AM UTC

Try creating a new GridBoundColumnsCollections object and populate this object with new GridBoundColumns in the order of their appearance. Then set this new GridBoundColumnsCollections object to the grid.GridBoundColumns property, and then call grid.Binder.InitialzeColumns. Here is a little sample that persists/restores the order of GridBoundBoundColumns to a binary file. It was done with an earlier version so, you should delete the MySizes.Bin file and change the references before building and running the sample. http://www.syncfusion.com/support/user/uploads/2862-1.zip

Loader.
Live Chat Icon For mobile
Up arrow icon