Hi!
I am using the code you posted in the sample. I have a grid showing products. The products have a field "categorycode" that points to table Categories. The grid has a column for "categoryCode", but I want to display the "Name" field of Categories table in that column. Is it possible to accomplish that using a dropdown column?
I used the same code you posted here:
DropDownList dropdown = new DropDownList();
dropdown.DataSourceID =
"ObjectDataSource1";
dropdown.DataTextField =
"Name";
dropdown.DataValueField =
"Code";
//Here we adding the DropDownListBox programatically using ITemplate Interface
TemplateClass mytemp = new TemplateClass(dropdown);
e.TableCellIdentity.Column.EditItemTemplate = mytemp;
In editing mode, I see the dropdown combo in the line but:
1- In categorycode column: the lines show the Code instead of the Name
2- when start editing, the combo selected value is not set to the current value of the row (this is, the Products.categoryCode is not looked up in the dropdrowncombo)
3- I select a value in the dropdown, but the column categoryCode doesn't get the value selected by me in the dropdown, it doesnt change.
Thanks,
Fernando
grid_and_dropdown_f1ceefb1.zip