This happens many times. I change a setting in the designer dialog, for example I add a column to the data schema, and then in code i try to reference this column by its key, and it throws "key not found" error. I check the cells collection and the column I added in the designer is not shown there.
Or a different example, I set the backcolor of a row in the designer but it doesn't reflect changes.
Is this a bug or what can I do to fix this problem?
Thank you.
Hi,
There are any number of reasons why you might lose a column that you added to the grid at design-time. The column might be lost when you bind the grid because the DataSource you are binding to doesn't match up the data structure you created at design-time. Or because you are binding the grid by setting the DataSource and DataMember individually instead of calling SetDataBinding.
Or, you could be loading a Layout into the grid at run-time which doesn't contain the newly-added columns.
It's really impossible for me to guess why it's happening without seeing the code and the application. I recommend that you take a look at this:
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?