Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a gridview with dropdownlist control filled with seqno form 1 -10.
How to bind gridview dropdown values from 1-10 scale and once the value is used it shouldn't be shown in another row dropdownlist.And on edit, if i am changing seqno it should update the existing serial number of another row dropdownlist if it exist for another row then.and vice versa..
Posted
Updated 6-May-15 0:00am
v2
Comments
Arkadeep De 6-May-15 6:12am    
have you tried any thing???

1 solution

You need to handle the DropDownList SelectedIndexChanged. Inside that event get the selected value of that DropDownList.

Then loop through all the rows of GridView and inside that remove that particular value from all the DropDownLists.

On the other hand, while updating the value of DropDownList, you need to get the previous option value from some data source or something. So, what you can do is that, initially when you get all the items, just store that in Session. While updating all the options inside the SelectedIndexChanged, just compare the data from the Session and add/remove from DropDownLists accordingly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900