Home Forums WinForms controls Xceed Grid for WinForms How to force column creation after new data bind?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17533 |

    Hi,

    We were using an old version of the grid for .Net 1.1 and recently started updating our product to use .Net 4 and the latest version of the Grid. Our code binds to a DataSet and then loops through the columns in the Grid and sets visibility of the columns based on data from an XML file. The old version of the grid had the columns available right after the data bind but the new version does not. I was wondering how I can force this to happen. I saw a very old post that stated you could create a new DataBindingContext and assign it to the grid’s BindingContext but this didn’t work either.

    Any help would be greatly appreciated.

    Thanks,

    Chris

    Imported from legacy forums. Posted by cpomer (had 1029 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, well, I answered my own question. I just do a Refresh() and the columns get created.

    EDIT: After further examination it looks like the real cause was because a BeginInit() had been done on the DataSet before data binding. By calling EndInit() before data binding the columns are created without a Refresh().

    Imported from legacy forums. Posted by cpomer (had 1037 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.