Get label text when dropdownlist is changed

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