I have a dropdownlist that was created in a radgrid in the ItemCreated event. The radgrid is auto-generating the columns, so I have implemented code found elsewhere on the site to replace the textbox control with a dropdownlist. I have successfully populated the dropdownlist with values at runtime. Now I wish to bind the new control to the field that the old textbox was bound to.
How do I bind the new control so the insert and update forms work?
Here is the code that creates the control in the ItemCreated Event:
else if (key == "3") |
{ |
objtxt.Visible = false; |
DropDownList drp = new DropDownList(); |
drp.DataSource = dataarray; |
item[SRfields[valuecount]].Controls.Add(drp); |
item[SRfields[valuecount]].Controls[1].DataBind(); //don't know if this is required |
} |