Does "DropDownList" support the "CommandName" event?

D

dvanderwel

I have a .NET 1.1 web page with a DataGrid containing a TemplateColumn
that contains a DropDownList.

I need to fire an event when the selected item in the DropDownList
changes for the current DataGrid row, and I'm having trouble figuring
out how to do this.

Other control types I have defined the "CommandName" property in the
aspx file. The event returns the index of the row that contains the
control, and I can thus pull more data out of the row.

In the case of the DropDownList, the CommandName property is not
available, and I can't figure out how to determine the index of the
DataGridRow that the DropDownList control lives in.

Does anyone know how I can go about doing this?
 
C

Coskun SUNALI [MVP]

Hi,

You can access the DropDownList being changed by converting the "sender"
argument of the event to a DropDownList. Then you may access the
DataGridCell and DataGridRow using the dropdown's "Parent" element. Again,
you will need to convert it to the corresponding type.



--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
 
D

dvanderwel

Cool thanks.

I tried doing that I but I wasn't able to find the DataGridRow within
the Parent element of the DropDownList.

I will look into this again, perhaps I just missed something.

Thanks for the advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top