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
570
save xamdatagrid
posted

Hello,

I have XamDataGrid in my form which has 2 columns: Project and Color which has dataTamplate with XamColorPicker.

I have a save button which has to save the XamDataGrid to dataTable . The thing is that i don't know how to convert XamDataGrid to DataTable. I need to do this in code (not in xaml)

I tried to use records as follows:

foreach(Infragistics.Windows.DataPresenter.Record c in ProjectDataGrid.Records)

                {

                    Infragistics.Windows.DataPresenter.DataRecord dr = (Infragistics.Windows.DataPresenter.DataRecord)c;

                    string s = dr.Cells[0].Value.ToString();

                    string k = dr.Cells[1].Value.ToString();

                }

 

but it takes my "old" values from the XamDataGrid (before i changed a color)