我正在使用 CodePlex 的工具包:DataGrid。
我正在代码中生成列。
我怎样才能设置相当于{绑定名字}在代码中?
或者,我怎样才能设置值,这就是我需要做的,不一定要绑定它。我只想要数据网格单元格中模型属性的值。
DataGridTextColumn dgtc = new DataGridTextColumn();
dgtc.Header = smartFormField.Label;
dgtc.Binding = BindingBase.Path = "FirstName"; //PSEUDO-CODE
dgtc.CellValue= "Jim"; //PSEUDO-CODE
CodePlexDataGrid.Columns.Add(dgtc);
未经测试,但以下应该有效:
dgtc.Binding = new Binding("FirstName");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)