Does "DropDownList" support the "CommandName" event?

  • Thread starter Thread starter dvanderwel
  • Start date Start date
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?
 
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
 
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.
 
Back
Top