I need to Convert DataGrid data to DataTable
here is my Code
Datatable dt=new DataTable()
dt=datagrid.ItemsSource as DataTable
MessageBox.Show(dt.Rows.Count.ToString());
I am getting Exception
Can anyone correct this?
I need to Convert DataGrid data to DataTable
here is my Code
Datatable dt=new DataTable()
dt=datagrid.ItemsSource as DataTable
MessageBox.Show(dt.Rows.Count.ToString());
I am getting Exception
Can anyone correct this?