This question is locked. New answers and comments are not allowed.
I have a grid set to GridEditMode.PopUp that has a DropDown list of items. When Adding a new item to the grid all values get displayed on the Grid except for the DropDown item. The item does save to the database and when I rebind the data shows correctly. The view is below:
<% Html.Telerik().Grid<ContactModel>()
.Name("ContactsGrid")
.DataKeys(keys => { keys.Add(c => c.Id); })
.ClientEvents(events => events
.OnError("RedirectOnError")
.OnDataBound("Contacts_onDataBound")
.OnRowDataBound("Contacts_onDataBound")
.OnDataBinding("Contacts_onDataBound")
)
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new
{style="margin-left:0"}))
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Delete().ButtonType(GridButtonType.Image);
commands.Edit().ButtonType(GridButtonType.Image);
})
.Width(100);
columns.Bound(c => c.Id);
columns.Bound(c => c.Name).Width(120);
columns.Bound(c => c.Title).Width(120);
columns.Bound(c => c.Address1).Width(120);
columns.Bound(c => c.Address2).Width(120);
columns.Bound(c => c.City).Width(120);
columns.Bound(c => c.State).Width(120);
columns.Bound(c => c.Zip).Width(120);
columns.Bound(c => c.PhoneOffice).Width(120);
columns.Bound(c => c.PhoneCell).Width(120);
columns.Bound(c => c.Fax).Width(120);
columns.Bound(c => c.Email).Width(120);
columns.Bound(c => c.ContactTypeId).ClientTemplate("<#= ContactType #>").Width(140).Title("Contact Type");
})
.DataBinding(dataBinding => dataBinding
.Ajax()
.Select("BindTempContacts", "Contacts")
.Update("UpdateTempContact", "Contacts")
.Delete("DeleteTempContact", "Contacts")
.Insert("InsertTempContact", "Contacts")
)
.Editable(editing => editing.Mode(GridEditMode.PopUp))
.Scrollable(scrolling => scrolling.Height(300))
.Resizable(resizing => resizing.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Sortable()
.Filterable()
.Pageable(paging =>
paging.PageSize(50))
.Selectable()
.Render();
%>
<% Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
{
%>
<% Html.Telerik().Grid<ContactModel>()
.Name("ContactsGrid")
.DataKeys(keys => { keys.Add(c => c.Id); })
.ClientEvents(events => events
.OnError("RedirectOnError")
.OnDataBound("Contacts_onDataBound")
.OnRowDataBound("Contacts_onDataBound")
.OnDataBinding("Contacts_onDataBound")
)
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new
{style="margin-left:0"}))
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Delete().ButtonType(GridButtonType.Image);
commands.Edit().ButtonType(GridButtonType.Image);
})
.Width(100);
columns.Bound(c => c.Id);
columns.Bound(c => c.Name).Width(120);
columns.Bound(c => c.Title).Width(120);
columns.Bound(c => c.Address1).Width(120);
columns.Bound(c => c.Address2).Width(120);
columns.Bound(c => c.City).Width(120);
columns.Bound(c => c.State).Width(120);
columns.Bound(c => c.Zip).Width(120);
columns.Bound(c => c.PhoneOffice).Width(120);
columns.Bound(c => c.PhoneCell).Width(120);
columns.Bound(c => c.Fax).Width(120);
columns.Bound(c => c.Email).Width(120);
columns.Bound(c => c.ContactTypeId).ClientTemplate("<#= ContactType #>").Width(140).Title("Contact Type");
})
.DataBinding(dataBinding => dataBinding
.Ajax()
.Select("BindTempContacts", "Contacts")
.Update("UpdateTempContact", "Contacts")
.Delete("DeleteTempContact", "Contacts")
.Insert("InsertTempContact", "Contacts")
)
.Editable(editing => editing.Mode(GridEditMode.PopUp))
.Scrollable(scrolling => scrolling.Height(300))
.Resizable(resizing => resizing.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Sortable()
.Filterable()
.Pageable(paging =>
paging.PageSize(50))
.Selectable()
.Render();
%>
<% Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
{
%>