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

[Solved] Display Recently selected items in combobox

2 Answers 131 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kalyani Mantripragada
Top achievements
Rank 1
Kalyani Mantripragada asked on 12 Jan 2010, 12:30 PM
Is it possible to add a section in the combobox list that shows the recently selected values, apart from displaying the data from db?

I have a search interface where I use the combo - autocomplete for a City field. I plan to save the searches that user does on this field for a few sessions and display them as a seperate section within the dropdown. The dropdown should still display the data from the assigned datasource.
Would this be possible to do?

thanks
-Kalyani

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Jan 2010, 02:05 PM
Hello Kalyani,

One suggestion would be using Labels in HeaderTemplate in order to show the recently accessed items. For that save the last selected items in an array and then save it in session variable. Then you can retrieve the array from session in pageload event, then access the Labels placed in HeaderTemplate using following code,
        (RadComboBox1.Header.FindControl("LabelID") as Label).Text = array[i];

and then set each Label's text by looping through the array items.

-Shinu.
0
Kalyani Mantripragada
Top achievements
Rank 1
answered on 12 Jan 2010, 02:17 PM
Thank you very much Shinu for your reply.

I was able to display the section in the way I wanted, however, I am not able to select the value from that section (just like selecting an item from the dropdown). Do you think it is possible?

thanks again.
Tags
ComboBox
Asked by
Kalyani Mantripragada
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kalyani Mantripragada
Top achievements
Rank 1
Share this question
or