Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2004, 04:23 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default catch event of dropdownlist inside datagrid

i am asking is there a way to catch event of dropdownlist inside datagrid...(template column have the dropdownlist and control postback property set to true)

i can do that using addhandler but... the dropdownlist is the only control which it's postback does not fire the datagrid_itemcommand event ???

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old July 16th, 2004, 07:44 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

i have found it it's to Edit aspx file and adding onselecteditemchanged="Sub_Name"


Ahmed Ali
Software Developer
 
Old July 19th, 2004, 09:05 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Command and link buttons will fire the ItemCommand event of the datagrid. Some other controls (like the drop down list as you have seen) will not. So you must do as Ahmed suggests.

If you need to access the datagrid item from the dropdown's event handler, you can access the DDL objects parent. So in the handler, "sender" will be the DDL and you can then access "sender.Parent...." to get at the datagrid item that the DDL is contained within. You might have to go back out several levels because the DDL's parent will be a cell, which is in the data grid item.
 
Old August 24th, 2004, 10:44 AM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

planoie -

Can you expand on this subject?

I am doing the exact same thing but when I try to access "sender" properties, Parent is not one of them.

Thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList Inside a datagrid @shish ASP.NET 1.0 and 1.1 Professional 3 January 29th, 2007 07:24 PM
dropdownlist inside datagrid myunus General .NET 11 October 29th, 2006 07:37 AM
How do I catch SelectionChangeCommitted event of a SupaHoopsa General .NET 1 February 24th, 2005 05:17 AM
dropdownlist inside datagrid shaileshmark General .NET 5 June 27th, 2004 05:18 AM





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