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

[Solved] Prepend action in Telerik dropdownList

3 Answers 68 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
saroj
Top achievements
Rank 1
saroj asked on 18 Mar 2012, 08:10 AM
Hi support,

How can we pass first empty selection in dropdownlist with value 0.

<select value="0" ></select>

It works for normal dropdownlist by using string .empty as below but in Telerik i couldn't figure out 
@Html.DropDownListFor(f => f.OWNERSHIP_ID, Model.OWNERSHIPS, string.Empty)

Thanks

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Mar 2012, 03:17 PM
Hello Saroj,

You can use the Placeholder method to insert en empty item.

Greetings,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
saroj
Top achievements
Rank 1
answered on 19 Mar 2012, 11:20 PM
Hi Petur,

I have used the placeholder it sets an empty item but i need to set its value as "0". How can i do that.
The Placeholder doesn't do that. Any idea?

Thanks
0
Petur Subev
Telerik team
answered on 20 Mar 2012, 09:59 AM
Hi again Saroj,

You can set the initial value of the hidden input element.
.HiddenInputHtmlAttributes(new { value = "-20" })


All the best,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
ComboBox
Asked by
saroj
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
saroj
Top achievements
Rank 1
Share this question
or