Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Everyone,

I have a class GridView -->Page: GridView.cs
using this class i am adding user controls
(two DropDownList: 1.ddlSubject, 2.ddlTeacher)
in each cell of GridView, which is in -->page: Default.aspx

Now when i change the selected index of ddlSubject SelectedIndexChange is called which is in GridView.cs (Because of user control)
i can find out the row index by sender-ddlSubject

Now i want to bind data in ddlTeacher in selected index change of ddlSubject

Please Help me..
Posted
Updated 10-Jan-13 22:32pm
v2

1 solution

Though you have not tagged it as ASP.NET, based on the question content it does look like an ASP.NET question.

Now, what you ask is a Cascading dropdown in Grid. You need to have Cascading Dropdown in place and then based on the dropdown values a filter on Grid data. Following will help:
Implementing Cascading DropDownList in ASP.NET GridView[^]
Ajax Cascading DropDownList With Database Example in GridView[^]
 
Share this answer
 
Comments
Pr!y@ 11-Jan-13 4:53am    
But sir i am using custom control..

I know Cascading dropdown. my problem is that how to find id of 2nd dropdown
Sandeep Mewara 11-Jan-13 7:46am    
Custom control? You sure?

What you seek is a cascading control only. When subject is changed, you want to show respective teachers. Above links should help. About finding ID, go through the code, internally it does find the row and then control to populate.

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