|120888||Oct 25,2015 04:27 PM||Oct 27,2015 03:06 AM||ASP.NET MVC||3|
Thanks for contacting Syncfusion Support.
Query 1: i want to show a drop down list with companies and wattermark text ("empty" default value as "--- Select Company ---"). When user clicks on a save button client validation must occur if user did not select any company.
We have prepared the sample based on your requirement and please refer to the following sample:
In this sample, we have passed DB data to the Datasource property of dropdownlist and set the dropdownlist properties in the server side as shown below code:
public ActionResult Index()
DropDownListProperties ddp = new DropDownListProperties();
ddp.DataSource = getMakes();
ddp.EnableFilterSearch = true;
ddp.WatermarkText = "--- Select Company ---";
ddp.Width = "100%";
DropDownListFields df = new DropDownListFields();
df.Text = "LastName";
df.Id = "EmployeeID";
df.Value = "LastName";
ddp.DropDownListFields = df;
ViewData["userCompany"] = ddp;
public List<Make> getMakes()
var ds = new DataClasses1DataContext();
List<Make> data = new List<Make>();
data = (from ord in ds.Employees
select new Make
EmployeeID = ord.EmployeeID,
LastName = ord.LastName
Could you please check with the above sample? If still see the same issue, please modifying the sample based on your application along with replication procedure and send it back to us.
Query 2: page reloads with filled form fields except EJ().DropDownListFor - it shows no data and also it looses it's styling and look like old-school html input field.
To render the controls kept inside partial view, we need to refer script manager in the partial view in which the controls are present. Then the control will be rendered properly. Please refer to the below code:
Please let us know if you need any further assistance.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.