I've a bit of a problem with Telerik radcomboboxes not updating properly on an aspx page. Essentially a user picks a choice 'yes' or 'no' from radcombobox 1. If the user chooses 'yes' then radcombobox 2 should show and radcombobox 3 should be hidden; if the user chooses 'no' then radcombobox 3 should show and radcombobox 2 should be hidden.
The code behind is vb.net. On the aspx page, combo box 1 is ajaxed and supposed to update the other two radcomboboxes. In the code behind in the SelectedIndexChanged sub for radcombobox 1, the 'visible' property of the radcombobox 2 and 3 are swapped depending on the user's choice.The problem is that the radcomboboxes do not appear to be swapping (i.e., updating on the aspx page) unless the page is reloaded, which I'm assuming happens because reloading the page is in essence forcing a postback.
I don't want to force a postback to fix this issue as I feel like that's a brute force workaround, and I want to understand why the logic isn't working as it should.Here's the actual code below. I used generic names for the radcomboboxes above.
Here's the code from combo box 1 SelectedIndexChanged sub:
Any help understanding why this doesn't work would be greatly appreciated!
The code behind is vb.net. On the aspx page, combo box 1 is ajaxed and supposed to update the other two radcomboboxes. In the code behind in the SelectedIndexChanged sub for radcombobox 1, the 'visible' property of the radcombobox 2 and 3 are swapped depending on the user's choice.The problem is that the radcomboboxes do not appear to be swapping (i.e., updating on the aspx page) unless the page is reloaded, which I'm assuming happens because reloading the page is in essence forcing a postback.
I don't want to force a postback to fix this issue as I feel like that's a brute force workaround, and I want to understand why the logic isn't working as it should.Here's the actual code below. I used generic names for the radcomboboxes above.
<telerik:AjaxSetting AjaxControlID=
"cboKey"
>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID=
"cboKey"
/>
<telerik:AjaxUpdatedControl ControlID=
"cboKey_X2"
/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID=
"cboKey_X2"
>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID=
"cboKey_X2"
/>
<telerik:AjaxUpdatedControl ControlID=
"cboKey"
/>
</UpdatedControls>
</telerik:AjaxSetting>
Here's the code from combo box 1 SelectedIndexChanged sub:
If
Me
.cboKey.Visible =
True
OrElse
Me
.cboKey_X2.Visible =
True
Then
If
piX2 <> 0
Then
Me
.cboKey.Visible =
False
Me
.cboKey_X2.Visible =
True
ElseIf
piX2 = 0
Then
Me
.cboKey_X2.Visible =
False
Me
.cboKey.Visible =
True
End
If
Any help understanding why this doesn't work would be greatly appreciated!