Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m creating an application that contains two dropdownlsts in a datagrid item template. i would like to fill the second dropdownlist according to the value in first drop downlist using itemtemplate. how can i invoke the selcted index change of first dropdown to fill the second dropdownlist. i have enabled the autopostback property of first dropdownlist to true
Posted
Updated 16-Feb-11 23:37pm
v2

go to tasks
click on edit template
select the column which contain dropdownlist and then select item template
now double click on dropdownlist.
 
Share this answer
 
Hope this[^] might help you.
 
Share this answer
 
SQL
simply,

manually write dropdown selectindexchanged event in sourcefile and .cs file and set autopostback=true.
then in selectedindexchanged event use sender object to retreive combobox selectedindex and text and use dropdownlist clientid to get selected row like

DropDownList ddl = (DropDownList)sender;

string s = ddl.ClientID;//use substring to retreive rowindex
if (ddl.SelectedItem.Text == "Your selected text")
{
dropdown1.Items.FindByText("Your text"].ToString()).Selected=true;}
 
Share this answer
 
Comments
ashwini hajgude 17-Feb-11 6:41am    
thanks it works

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