I'm using the toolkit:DataGrid from CodePlex.
I'm generating the columns in code.
How can I set the equivalent of {Binding FirstName} in code?
Or alternatively, how can I just set the value, that's all I need to do, not necessarily bind it. I just want the value from my model property in the cell in the 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);
Untested, but the following should work:
dgtc.Binding = new Binding("FirstName");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With