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

[Solved] How can I revert back my selection made to a Datasource Text?

2 Answers 142 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Devna
Top achievements
Rank 1
Devna asked on 14 Nov 2014, 03:02 AM
Hi,
I have a dropdown list of say
-Fruits
-Apples
-Orange
-Nothing
-Banana

My initial selection is "Apples". When I select "Nothing" I can stop an event from doing anything but I want the display to not switch to "Nothing" but stay at the old selection say "Apples".

How can I achieve this?

Thanks and Regards
Devna

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 17 Nov 2014, 03:17 PM
Hello Devna,

I would suggest you check the select event of the widget. It allows to prevent the selection, hence the previous selected value/text will stay. Here is a code snippet that shows how to prevent the event:
function dropdownlist_select(e) {
  e.preventDefault(); //prevent selection
}

Let me know if something is unclear.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Devna
Top achievements
Rank 1
answered on 18 Nov 2014, 03:51 AM
Thanks Georgi. It works fine.
Tags
DropDownList
Asked by
Devna
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Devna
Top achievements
Rank 1
Share this question
or