Click here to Skip to main content
14,303,730 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 3

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.
Thanks,
Imdadhusen
   
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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100