This is a migrated thread and some comments may be shown as answers.

maintaining selected item(from LoadOnDemand) on page reload

1 Answer 48 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 04 Jan 2013, 11:05 AM

im loading items using loadondemand(ItemsRequested) on a usercontrol ascx i also attach attributes to items

eg

item.Attributes.Add("onclick", "NavigateAreaSelection(" + CRMAreaID + ")")


the problem i have is that when you select an item i navigate to a different page but would like to keep the 
selected item selected, i try to do this on the page load of the usercontrol but i find that it doesn't have any items and will always be empty
So How do i Maintain the selected input or populate the combobox on navigating to a different page ?


below page load 

If ComboAllContacts.Items.FindItemByValue(AreaHelper.GetSelectedAreaID())
IsNot
Nothing Then ComboAllContacts.SelectedValue = AreaHelper.GetSelectedAreaID()End If


1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 05 Jan 2013, 03:57 PM
Hello Ryan,

When using LoadOnDemand, the items don't exist in the list until they are requested. So to add it to the list during the page load event, you will have to manually add an item to the RadComboBox, instead of trying to find and select it.

I hope that helps.
Tags
ComboBox
Asked by
Ryan
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or