I have a WinGrid which is connected to a WinDataSource. I have spent time arranging the field layouts in the grid. Now I add a new field to the WinDataSource. When I go back to the WinGrid, the new field is not represented. So I would like to "Update" the WinGrid to see that there is a new field in the DataSource. The only way I have found to do so, is to change the DataMember property of the grid, and then reset it. Unfortunately, doing so also resets the whole layout that I painstakingly set up.
How can I have the WinGrid recognize there is a new field in the DataSource without messing up the columns layouts.
I tried a simple test with the grid bound to a DataTable and it worked - Column order and cell appearances were maintained when a new column was added to the DataTable to which the grid was bound, and the new column appeared as expected. The grid listens for the binding manager's ListChanged event, which fires when a new property descriptor is added or removed.
If adding a new column to the WinDataSource doesn't behave the same way, it is probably a bug in that component, so you might want to report it as such.
Thanks for your reply.
First of all, you say you are using a DataTable. I'm using the WinDataSource. They may act differently
second, perhaps the reason why it doesn't work by me, is because I am adding the new column to a child band.
My WinDataSource is made up of a primary band (Order), and a child band (Items). Both of these are shown in the DataGrid. If I add a new column to the child band (Items), it does not show up in the grid in design mode (although it does show up when the app is run).
See if you can duplicate that.