Hello,
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:
@(Html.EJ().Grid<IEnumerable<RecipeManager.ViewModels.UsersAndRoles>>("AdminGrid")
.Datasource(Model.UsernamesAndRoles)
.AllowSorting()
.AllowPaging()
.ToolbarSettings(x =>
{
x.ShowToolbar()
.ToolbarItems(y =>
{
y.AddTool(ToolBarItems.Search);
y.AddTool(ToolBarItems.Add);
y.AddTool(ToolBarItems.Edit);
y.AddTool(ToolBarItems.Delete);
y.AddTool(ToolBarItems.Update);
y.AddTool(ToolBarItems.Cancel);
});
})
.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();
col.Field("Role").HeaderText("Role").Width(80).EditType(EditingType.Dropdown).DataSource(Model.RoleOptions).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