Question

My webpage is built dynamically in VB.Net (aspx).

I have a checkbox, that after checked will open a new window. While opening the window some parameters are passed through for using the correct data in the window, however there is one parameter (FM) which has an unknown value at the time the checkbox is checked.

This parameter is dependant on a value inside another dynamically built control named ddlFM (radcombobox). For passing this last parameter I will be using a session parameter. This parameter on his turn should be filled when one of the radcomboboxes changes it's value.

In the build function I created the following: (edited)

Dim ddlFM As New RadComboBox
Dim sdsFM As New SqlDataSource()

ddlFM.DataTextField = "Value"
ddlFM.DataValueField = "Value"

cell.Controls.Add(ddlFM)
AddHandler ddlFM.SelectedIndexChanged, AddressOf Me.ddlFM_SelectionChanged
cell.Controls.Add(sdsFM)

sdsFM.SelectCommand = 'select values from table'
sdsFM.SelectCommand = 'Connectionstring'
sdsFM.DataBind()

the Me.ddlFM_SelectionChanged will be as follows:

Public Sub ddlFM_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
    getAllCycleNumbers()
End Sub

here the getAllCycleNumbers makes sure the correct session id's are filled in.

My problem here is that the event doesn't seem to be fired...

EDIT:

After a post of Murray (which then dissappeared) i added the following line

Friend WithEvents ddlFM As RadComboBox

This however did nothing...

Was it helpful?

Solution

Does it help if you do it like this?

AddHandler ddlFM.SelectedIndexChanged, New EventHandler(AddressOf ddlFM_SelectionChanged)

do you also maybe need

ddlFM.AutoPostBack = True
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top