Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2005, 11:03 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: San Francisco, CA, USA.
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default catching the OnSelectedIndexChanged event

How can I catch/Handle the OnSelectedIndexChanged of a Dropdown list control that is inside a datagrid?

Thanks!

Reply With Quote
  #2 (permalink)  
Old October 5th, 2005, 02:51 PM
Registered User
 
Join Date: Oct 2005
Location: , Virginia, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My experience is in using a table instead of a datagrid so I don’t know if it can be done in a datagrid or if you will have to resort to a DataList or DataTable but I am hoping you can glean something from it in either case. What I did was created a new control that inherited from the dropdown list with the addition of a variable that allowed me to check which line of the data it was triggered from. When I created the row for the datatable and thus the dropdown list I set this variable to the itemID value and created an event handler that handled the output from the dropdown list on each row of the data.

In the handler I then checked for this code to know which line triggered the event.
This isn’t the exact code (is coming from memory)and thus may need some tweaking but basically in C#::

private class myDropDownList: DropDownList()
{
int dataRowID

}
and
private void my DropDownListHandler(object sender, System.EventArgs e)
{
myDropDownList ddl=object as myDropDownList;
itemID=ddl.dataRowID;

//rest of the handler code
}

let me know if this helps

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6, OnSelectedIndexChanged roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 June 16th, 2008 05:02 PM
onSelectedIndexChanged event not firing??? MTLedari ASP.NET 2.0 Basics 5 December 19th, 2006 10:35 AM
OnSelectedIndexChanged event not firing ethertt77 ASP.NET 2.0 Basics 2 February 20th, 2006 07:34 PM
Catching exceptions thrown from an event... jacob C# 5 December 6th, 2005 12:48 PM
DropDownList - OnSelectedIndexChanged LarryH ASP.NET 1.0 and 1.1 Basics 1 February 2nd, 2005 12:51 AM



All times are GMT -4. The time now is 10:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.