-1

I'm using Datatable in C# just to rely it to a datagrid in WPF, the problem is when i change the column name, all the data in this column are loss, i tried This stackoverflow article but the same problem still remain, can someone help me please?

thanks

Community
  • 1
  • 1
  • What are you using as your data store? How are you changing the column name? Are you losing the data in the data store, or are you just renaming it in memory and then it's not mapped correctly? Same sample code would be great. – Prescott Oct 20 '15 at 21:13
  • @Prescott I'm not using a data store, i'm using a datatable just as a container of a data that i will bind with a datagrid in WPF, i 'm changing the column name as following : dt.Columns["oldColumnName"].ColumnName = "newColumnName"; i loose the data in memory, thanks – user4641046 Oct 21 '15 at 14:09
  • I found the problem ... WPF doesn't accept datatable column name with special characters, anyway thank you @Prescott – user4641046 Oct 21 '15 at 16:58

1 Answers1

1

I found the problem ... WPF doesn't accept datatable column name with special characters, anyway thank you @Prescott