The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator 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