troubleshooting Question

dropdownlist in a datagrid

Avatar of scorp8
scorp8Flag for United States of America asked on
C#
6 Comments1 Solution322 ViewsLast Modified:
I've setup a template column with a dropdownlist.  I have an Insert button that adds a null row to the datagrid to insert new records.  In order to properly insert a new row, I have to populate my ddl with data from another table due to the relation with that table.  I'm having a problem trying to populate this ddl.

//dtType is my datatable
dtType Type = new dtType();

DropDownList list = (DropDownList)
dgGrid.FindControl("dgGrid");
                  
list.DataTextField = "ddlType";
list.DataValueField = "IDType";
list.DataSource = Type;
list.DataBind();

Any Suggestions?

scorp8
ASKER CERTIFIED SOLUTION
Agarici

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros