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
80
Syncing order of columns in DataTable and XamDataGrid
posted

Hi,

I have a DataTable which acts as a data source to XamDataGrid. At runtime, I'm adding multiple columns to the DataTable dynamically and the columns are sorted in Alphabetical Order in DataTable. E.g. :

DataTable / XamDataGrid:

ACD
London New York Paris

Now if I add a new column 'B' - It will be added at 2nd position and not at the end. So the DataTable will look something like this :

DataTable :

ABCD
London Tokyo New York Paris

However, in XamDataGrid the new column is always added at the end, which does not maps correctly with the DataTable

XamDataGrid :

ACDB
London New York Paris

Tokyo

So, Is there anyway to make sure the order of columns in DataTable and XamDataGrid is always in Sync ?