SelectedIndexChanged is not working for my comdobox inside of a datagrid

J

Jason Tepe

Hello,

I have this problem. I have a Datagrid with a comdobox in it. I want
to be able to get at the SelectedIndexChanged event of the comdobox. I
have this code in the comdobox ItemCreated event.

Private Sub dgPrimaryContacts_ItemCreated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgPrimaryContacts.ItemCreated

If e.Item.ItemType = ListItemType.EditItem Then
Dim lst As ListBox = e.Item.FindControl("RoleList")
AddHandler lst.SelectedIndexChanged, AddressOf
ListSelect
End If

End Sub

This does fire but not Handler is added to comdobox. I also have the
Handler for the comdobox done.

Private Sub ListSelect(ByVal sender As Object, ByVal e As
System.EventArgs)
'Some code
End Sub

When I change an item in the combobox. This ListSelect sub is never
called.

Please help, what am I doing wrong?

Thanks,
Jason
 

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
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top