Click here to Skip to main content
15,912,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have added dropdownlist dynamically in gridview.
For an example, there are 5 dropdownlists at runtime.
If user selects 2nd dropdownlist,i need the count of the selected row. Whether 2nd row or third row...?
how to code for that....
Posted
Comments
sukumari1 27-Mar-13 4:13am    
i have solved this myself.
DropDownList dropindex = (DropDownList)sender;
GridViewRow gridviewRow = (GridViewRow)dropindex.NamingContainer;
int rowcount = gridviewRow.RowIndex;

1 solution

DropDownList dropindex = (DropDownList)sender;
GridViewRow gridviewRow = (GridViewRow)dropindex.NamingContainer;
int rowcount = gridviewRow.RowIndex;
 
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