Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having one drop down list with data as

now when i select any value i want this value should be assign to other dropdown present in grid.

first drop down is outside grid...

Hi Tejas,

Do the following:

1. set the AutoPostback=true and create the event dropdown1_selectedIndexChanged event

2. write the inside the above event

for(int i=0;i<gridview1.rows.count;i++)>
//assumed your dropdown would be exists in second position or column
//Dropdown2 is the id of dropdown which is inside the gridview item template
DropdownList drp2 = (DropdownList) gridview1.Rows[i][2].findControl("Dropdown2");
drp2.selectedItem.Text = Dropdown21.selectedItem.Text;

Please do let me know, if you have any doubt.
Please provide Vote if this would be helpful to you.
Share this answer
tejasvee 16-Sep-10 8:38am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
tejasvee 16-Sep-10 8:40am    
hi actually code you gave is working but now if i select waiting in first drop down in second drop down it gives waiting value but replaces to assigned
Hi Tejas,

Please confirm following:

1. You have one drop down which is outside of the grid and it's contains Assign, Waiting, Finished options?

2. when selecting any of the option from drop down. you need to change the value of drop down inside the grid accordingly?

Please confirm my thoughts.

Share this answer
Kunal Chowdhury «IN» 13-Sep-10 5:05am    
ya you are second drop down in grid also have same option so i ust want to change them according to first drop down
Posted by: tejasvee358

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