DataGridView Question

S

S Chapman

I have a DataGridView on my page that uses Template Fields for some of
the cells. One such cell has a DropDownList as a control on the
EditItemTemplate. The user using a button on the page can add items to
this drop down. I am unable to get a reference to this drop down list
on the "template" so that I can add the new item to the list.


I am able to however get a reference to specific row-wise instances of
the DropDownList using:

_grdMain.Rows[nIndex].FindControl("_cmbList")

Do I have to add items to these individual controls or is it possible
to obtain a reference to the template control itself and add the item
only once? Thanks.
 
M

Mridul

I think instead of trying to add item to DropDownList, you can add
item to data source of DropDownList.
This step will automatically add item to DropDownList and you don't
need any reference of DropDownList.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top