【发布时间】:2010-10-29 07:45:23
【问题描述】:
我正在使用 CodePlex 的工具包:DataGrid。
我正在代码中生成列。
如何在代码中设置 {Binding FirstName} 的等效项?
或者,我怎样才能设置值,这就是我需要做的,不一定绑定它。我只想要数据网格中单元格中模型属性的值。
DataGridTextColumn dgtc = new DataGridTextColumn();
dgtc.Header = smartFormField.Label;
dgtc.Binding = BindingBase.Path = "FirstName"; //PSEUDO-CODE
dgtc.CellValue= "Jim"; //PSEUDO-CODE
CodePlexDataGrid.Columns.Add(dgtc);
【问题讨论】: