User (Old forums)MemberAugust 15, 2007 at 10:58 amPost count: 23064
I created a DataGrid control which has 2 colums in design time (created with Blend). In run-time I add a new column (named “Yoav”), and add 2 items which contain 1 character for each column.
My problem is that the first 2 columns (that was created by Blend) are empty and the text does not appear. (In the 3rd column its OK).
Here is my code (where I add the 3rd column and add 2 rows):
// add a column
Column aYoavColumn = new Column();
aYoavColumn.Title = “Yoav”;
aYoavColumn.FieldName = “Yoav”;
aYoavColumn.DisplayMemberBinding = new System.Windows.Data.Binding(“”);
(aYoavColumn.DisplayMemberBinding as System.Windows.Data.Binding).Mode = System.Windows.Data.BindingMode.TwoWay;
// fill the grid with two rows
String rowData1 = new String;
rowData1 = “A”;
rowData1 = “B”;
rowData1 = “C”;
String rowData2 = new String;
rowData2 = “A”;
rowData2 = “B”;
rowData2 = “C”;
Can someone please explain why I do not see the text in the first 2 columns ?
Note: the “DisplayMemberBinding” property in my first 2 columns is empty (I get an error message when I try to insert a value there).
Imported from legacy forums. Posted by Yoav (had 424 views)Xceed SupportMemberAugust 15, 2007 at 11:09 amPost count: 5658
Setting the DisplayMemberBinding property should solve the problem. What value are you trying to set and what error are you getting when you are setting it?
Imported from legacy forums. Posted by Jenny [Xceed] (had 268 views)User (Old forums)MemberAugust 16, 2007 at 1:52 amPost count: 23064
I tried to set the value “”
In the field “DisplayMemberBinding” -> “Custom Expression…”
and the error message I get is: “Unable to convert the given expression to a valid value. Exception: Does not support Value to String conversion.”
Imported from legacy forums. Posted by Yoav (had 218 views)
- You must be logged in to reply to this topic.