Get label text when dropdownlist is changed

S

staeri

I have a datagrid containing one TemplateColumn with a label
(lblObjectID) and one TemplateColumn with a DropDownList.

When the DropDownList is changed I want to capture the value in the
TemplateColumn with the label. How can I do that?

I'm using the following code:

Private Sub ddContract_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)

Dim strContractID As String = CType(sender,
DropDownList).SelectedItem.Value
Dim strObjectID As String = ???

End If

Regards,

S
 
E

Eliyahu Goldin

Try using ItemCommand event. If I am not mistaken, it should fire on the ddl
selection change. Through the event's second parameter you can get to the
item (row), from item to the cell with the label and FindControl on the
cell.
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top