PDA

View Full Version : [CLOSED] Dropdown with Tree Panel not displaying default text (Razor view/2.0)



machinableed
Mar 13, 2012, 2:58 AM
Using the code below:


fields.Add(Html.X().DropDownField()
.FieldLabel("Product/Service Type")
.Margins("0 0 0 0")
.LabelWidth(200)
.Width(400)
.Text("--- Please Select ---")
.Cls("form-label")
.Component(treePanel => treePanel.Add(Html.X().TreePanel()
.Height(300)
.Width(400)
.RootVisible(false)
.Root(root =>
{
//tree panel stuff
}));

The text "--- Please Select ---" doesn't appear in the box on page load. I would like this present to encourage the user to click and expand the tree...

Vladimir
Mar 13, 2012, 10:58 AM
Hi,

At this moment, Please use Value instead Text

Vladimir
Mar 13, 2012, 11:23 AM
Also, in your case it is better to use EmptyText