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.
Hello,
Thank you for your feedback. Please let me know if you need any further assistance on this.
Thank you.
I watched your video, but I don't know if it will work in my case, because I discovered that my original question might have been in error. I was looking for the addition column in the wrong band, so I thought it didn't appear. It might have actually been in the correct band all along.
I'm very sorry. Thanks for your assistance anyway.
Did you try my latest suggestion and did you were able to download and see the video that I post in my previous post ?
What is the results when you try my suggestion ?
Also what could you do is saving your layout via designer, reset your UltraDataSource, bind the Grid to UltraDataSource and load saved layout. Doing so you shouldn’t lose your layout and you will be able to use it in future.
I am waiting for your response.