We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Dropdownlist not displaying current value upon editing

Thread ID:





127031 Oct 21,2016 04:10 PM UTC Oct 24,2016 06:56 AM UTC ASP.NET MVC 1
Tags: Grid
Greg Hofman
Asked On October 21, 2016 04:10 PM UTC

Currently experiencing the following issue: When my grid loads, all dropdowns show the correct value as passed to them by their datasource. However, when I click to edit a row, the dropdown will blank out and not show any selected option. The dropdownlist of a certain row that is being edited should default to the current value in the datasource. Code and screenshots below:

Grid control:

          .ToolbarSettings(x =>
              .ToolbarItems(y =>
          .EditSettings(x => { x.AllowAdding().AllowDeleting().AllowEditing(); })
          .ClientSideEvents(e => e.ToolbarClick("toolbarClicked"))
          .ClientSideEvents(e => e.ActionBegin("actionBegin"))
          .Columns(col =>
              col.Field("RowNumber").HeaderText("Row Number").Width(75).IsPrimaryKey(true).AllowEditing(true).Add();
              col.Field("Username").HeaderText("User Name").Width(75).Add();

In the attached zip file, please see before.png for a screenshot of the grid after page load. See after.png for a screenshot immediately after clicking "edit" on a row. 

Attachment: dropdownIssue_150e534.zip

Prasanna Kumar Viswanathan [Syncfusion]
Replied On October 24, 2016 06:56 AM UTC

Hi Greg, 

Thanks for contacting Syncfusion support. 

We suspect that you have not binded the dataSource for the dropdownlist in text and value format. To avoid the mentioned issue, the datasource binded for the dropdown list must be passed in the value and text format. 

Find the code example and sample: 

.Columns(col => 
    col.Field("EmployeeID").HeaderText("Employee Name").EditType(EditingType.Dropdown).TextAlign(TextAlign.Left).DataSource((List<object>)ViewData["EmployeeID"]).Width(90).Add(); 


public ActionResult GridFeatures(string id) 
            ViewData["EmployeeID"] = EmployeeID; 
        public List<object> EmployeeID 
                var employeeID = db.OrdersViews.Select(s => s.EmployeeID).Distinct().ToList(); 
                var EmployeeID = new List<object>(); 
                foreach (var id in employeeID) 
                    EmployeeID.Add(new { value = id, text = id }); 
                return EmployeeID; 

Prasanna Kumar N.S.V 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon