Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1015
Update WinGrid with added field from WinDataSource
posted

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.

Parents
  • 69832
    Offline posted

    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.

Reply Children