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.
Imported from legacy forums. Posted by cpomer (had 1029 views)
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)