1
我必须忘记明显的东西......我无法以编程方式绑定DataGridColumn。我有以下代码:如何以编程方式绑定数据网格列?
var datagrid = new DataGrid();
datagrid.Columns.Add(new DataGridTextColumn()
{
Header = "Type,
Width = new DataGridLength(200),
FontSize = 12,
Binding = new Binding("Name") // this line fails to complile
});
我不断收到以下编译错误:
Error 3 The type or namespace name 'Binding' could not be found (are you missing a using directive or an assembly reference?)
我见过很多在线的例子,似乎在做同样的事情...任何想法? 谢谢,
哇......它的确如此简单....我只是不明白为什么第一个绑定没有错误(只有在NEW之后的第二个绑定) - 但补充说明解决了问题当然 ... – JSchwartz 2013-04-25 12:14:55