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

[Solved] empty value like microsoft optionlabel

1 Answer 91 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.
Unik
Top achievements
Rank 1
Unik asked on 02 Dec 2010, 08:44 PM
Hi,

I use a Dropdownlist load on demand and i whant the first value to be empty.  I whant to know how to do that or if you plan to add this feature to your control.

thank's

1 Answer, 1 is accepted

Sort by
0
al
Top achievements
Rank 1
answered on 03 Dec 2010, 12:56 AM
Hi mate,
What you could do is download the source code and modify that part and it will do the way you want it.
Go the the source project:
Telerik.Web.Mvc>UI>DropDownList>DropDownListHtmlBuilder.cs

Change this line from : input.Attribute("value", selectedItem.Value.HasValue() ? selectedItem.Value : selectedItem.Text);
to :input.Attribute("value", selectedItem.Value.HasValue() ? selectedItem.Value : "");
This is located at the end of the file.

Rebuild it and use the DLL.

Tags
ComboBox
Asked by
Unik
Top achievements
Rank 1
Answers by
al
Top achievements
Rank 1
Share this question
or