Hi, all

I Have a problem with the DropDownList in a DataGridView( I am using ASP.Net c#).

I Would like to fill the DropDownList in the DataGridView with information retrieved from a DataTable for example if a particular product I have 10 left in stock I would like to fill the DropDownList from 1-10 so that the customer can only buy from 1-10 as Quantity of that particular product,

The problem is that in the code behind since the DropDownList is in a DataGridView I cannot access it directly therefore I can't user DropDownList1.Items.add("");

Any Suggestions please?

Thanks,
Regards Chris.

Recommended Answers

All 2 Replies

Try posting your question to the ASP.NET forum.
This forum is for classic ASP.
If you can not access the DropDownList directly I'm not sure how you are able to populate it.
Is it possible to just limit the range of values (i.e. no more than 10) perhaps?

Hi, all

I Have a problem with the DropDownList in a DataGridView( I am using ASP.Net c#).

I Would like to fill the DropDownList in the DataGridView with information retrieved from a DataTable for example if a particular product I have 10 left in stock I would like to fill the DropDownList from 1-10 so that the customer can only buy from 1-10 as Quantity of that particular product,

The problem is that in the code behind since the DropDownList is in a DataGridView I cannot access it directly therefore I can't user DropDownList1.Items.add("");

Any Suggestions please?

Thanks,
Regards Chris.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.