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
558
Refresh Fields
posted

I have a XamDataGrid that is bound to a DataTable.  The DataTable has dynamic fields.  It has 1 standard column, Name, but then can have up to N other columns in it, based on certain settings.  When I populate the fields at run time, everything works fine.  However, on load time, it's failing.  In other words, the user opens application and sees the grid with Name, First and Last as the 3 columns in the data grid.  But then the user selects a few other attributes they want to see and hits the reload button.  When I bind the data to the new DataTable, the fields are not refreshed so I don't see the newly added columns.

I was playing around with grd.RaiseEvent(new RoutedEventArgs(XamDataGrid.FieldLayoutInitializedEvent)) but that didn't work for me.  Any suggestions would be greatly appreciated.

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post and I created a sample project for you in which I put a XamDataGrid and a Button which changes its DataSource and it seems like everything works ok on my side.

     

    Feel free to write me if you have further questions.

    xamDataGridChangeDataSource.zip