2013-04-22 96 views
0

我遇到了一个问题:如果列标题的名称中有一个点,它不会显示此列中单元格的值。显示问题datagrid

我该如何解决此问题而不更改列的名称?

var ds = new DataSet(); 
      var dataPylons = new DataTable(); 
      ds.Tables.Add(dataPylons); 

foreach (var i in pylonItem) 
      { 
       cl = new DataColumn(i.Code + "\n" + i.Sheme, typeof(string)); 
       dataPylons.Columns.Add(cl); 
      } 

// In the cycle fill cell 
dataPylons.Rows[i][j] =...; 
... 
DataGridPylons.ItemsSource = ds.Tables[0].DefaultView; 

实例错误: https://docs.google.com/file/d/0B3wJRn2hp50hTm9uX2FkRUg1dTQ/edit?usp=sharing

+0

我完全不鼓励在WPF客户端使用'System.Data'类。改为创建适当的数据模型。 – 2013-04-22 20:48:42

+0

如何正确生成表格的内容? – user2308845 2013-04-22 20:55:51

回答