This question is locked. New answers and comments are not allowed.
Using 2011.1.315 I cannot get the ComboBox to update if one of the items has a blank for the Text value. I either receive a g.slice or e.replace JavaScript error.
I would like to have one entry in the ComboBox display a blank for the Text as if nothing was chosen. Right now I have to remove this blank from the list of items to get the control to function. Is there a work around for this?
here's my view:
The Edit Template for the column "Car". It is a list of numerical values from 0 to 99 along with a blank at the top and "none" at the bottom.
The Controller for the Template:
I would like to have one entry in the ComboBox display a blank for the Text as if nothing was chosen. Right now I have to remove this blank from the list of items to get the control to function. Is there a work around for this?
here's my view:
<%= Html.Telerik().Grid<
EntryList
>()
.Name("EntryList")
.DataKeys(keys =>
{
keys.Add(p => p.RaceResultsID);
})
.ToolBar(toolbar => {
toolbar.Insert();
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("_SelectEntryListDrivers", "EntryList")
.Update("_UpdateDriver", "EntryList")
.Insert("_InsertDriver", "EntryList")
.Delete("_DeleteDriver", "EntryList");
})
.Columns(columns =>
{
columns.Bound(p => p.Name).Width(115);
columns.Bound(p => p.Car).Width(40);
columns.Bound(p => p.Manufacturer).Width(75);
columns.Bound(p => p.Sponsor).Width(175);
columns.Bound(p => p.Owner).Width(200);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Width(75).Title("Actions");
columns.Bound(p => p.PersonID)
.ClientTemplate(Html.ActionLink("Person Edit", "Edit", new { area = "util", controller = "Person", ID = "<#= PersonID #>" }, new { target = "_blank", @class = "t-button" }).ToString()).ReadOnly(true).HtmlAttributes("class='t-button'").Title("Utility").Width(75);
columns.Bound(p => p.RaceResultsID).Width(25).Hidden(true);
columns.Bound(p => p.DriverEntity).Width(25).Hidden(true);
columns.Bound(p => p.OwnerID).Width(25).Hidden(true);
columns.Bound(p => p.NumberID).Width(25).Hidden(true);
columns.Bound(p => p.SponsorID).Width(25).Hidden(true);
columns.Bound(p => p.ManufacturerID).Width(25).Hidden(true);
columns.Bound(p => p.SubSeriesName).Width(5).Hidden(true);
columns.Bound(p => p.VehicleID).Width(5).Hidden(true);
})
.Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.Name).Ascending()))
.Reorderable(reorder => reorder.Columns(true))
.ClientEvents(events => events.OnSave("onSave"))
.ClientEvents(events => events.OnEdit("onEdit"))
%>
The Edit Template for the column "Car". It is a list of numerical values from 0 to 99 along with a blank at the top and "none" at the bottom.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.Telerik().ComboBox()
.Name("Car")
.DataBinding(binding => binding.Ajax().Select("_SelectCarNumbers", "EntryList"))
.AutoFill(true)
.Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith).MinimumChars(1))
.HighlightFirstMatch(true)
.ClientEvents(events => events.OnDataBinding("onCarDataBinding"))
%>
The Controller for the Template:
[HttpPost]
public ActionResult _SelectCarNumbers(int eventID)
{
var list = _util.GetOwnerNumberListByID(Int32.MinValue, Int32.MinValue, eventID);
var car = list.AsQueryable();
return new JsonResult { Data = new SelectList(car.ToList(), "NumberID", "NumberText") };
}