Click here to Skip to main content
15,867,756 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
Assign
Waiting
Finished

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...
Posted

Hi Tejas,

Do the following:

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

2. write the inside the above event

C#
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.
Thanks,
Imdadhusen
 
Share this answer
 
v3
Comments
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.


Thanks,
Imdadhusen
 
Share this answer
 
Comments
Kunal Chowdhury «IN» 13-Sep-10 5:05am    
ya you are right...my 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