Click here to Skip to main content
12,634,982 members (23,089 online)
Rate this:
 
Please Sign up or sign in to vote.
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 10-Jan-13 22:23pm
Pr!y@1.2K
Updated 10-Jan-13 23:32pm
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
Harshit Raj Singh 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161208.2 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100