Hi
I am trying to Cascade a Multi select from a drop down list and am having issues getting the value of the dropdown list to pass into the controller.
My Drop down code is:
<h4 style="margin-top: 2em;">Sub Sub Category:</h4>
@(Html.Kendo().DropDownList()
.Name("category3")
.OptionLabel("Select Sub Sub Category")
.DataTextField("Description")
.DataValueField("Id")
.DataSource(source =>
{
source.Read(read => { read.Action("GetCategory3", "CampaignSimple").Data("filterCategory3"); }).ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("category2")
.Events(e => e.Select("select"))
)
<script>
function filterCategory3() {
return {
category2: $("#category2").val()
};
}
</script>
And my MultiSelect code is:
<h4 style="margin-top: 2em;">Ad Group</h4>
@(Html.Kendo().MultiSelect()
.Name("adgroup")
.Placeholder("Select AdGroup")
.DataTextField("Description")
.DataValueField("Id")
.DataSource(source =>
{
source.Read(read => { read.Action("GetAdGroups", "CampaignSimple").Data("filterAdGroups"); }).ServerFiltering(true);
})
.AutoBind(false)
.Enable(false)
)
<script type="text/javascript">
function filterAdGroups() {
return {
category3: $("#category3").val()
};
}
function select(e) {
var dropdownlist = $("#category3").data("kendoDropDownList");
dropdownlist.select(e.item.index());
var multiselect = $("#adgroup").data("kendoMultiSelect");
multiselect.dataSource.read();
multiselect.enable(true);
};
</script>
When I select an item from the drop down list it does go into the the controller method but the parameter is always null.
Any ideas?
Thanks in advanced

So I have an MVC grid where I'm saving the grid settings to localstorage so that I can load the filters and the current page back to the same spot when navigating back from another action. It all works great for almost all of the columns, except for the date column (LastUpdatedDate below). The date entered is there, but you must click the Filter button again on this column to apply it, where on other columns, the filter is applied already on load. Any ideas? Page code below.
@{
ViewBag.Title = "Vendors";
}
<h2>Vendors Index</h2>
@(Html.Kendo().Grid<VendorRegistry.Models.Vendor>()
.Name("grid")
.Columns(columns =>
{
//Excel like filtering on columns. Pulls from datasource because default shows them not in order. See Expired for default without datasource.
columns.Bound(c => c.CompanyName).Filterable(ftb => ftb.Multi(true).Search(true).DataSource(ds => ds.Read(r => r.Action("GetCompanies", "VendorGrid"))));
columns.Bound(c => c.Address1).Filterable(ftb => ftb.Multi(true).Search(true).DataSource(ds => ds.Read(r => r.Action("GetAddresses", "VendorGrid"))));
columns.Bound(c => c.City).Width(110).Filterable(ftb => ftb.Multi(true).Search(true).DataSource(ds => ds.Read(r => r.Action("GetCities", "VendorGrid"))));
columns.Bound(c => c.LastUpdatedDate);
columns.Bound(c => c.Expired).Filterable(ftb => ftb.Multi(true));
columns.Bound(c => c.Vetted).Filterable(ftb => ftb.Multi(true));
columns.Template(@<text></text>)
.ClientTemplate("<a class='k-button k-button-icontext' href='Vendors/Edit/#= ID#'><span class='k-icon k-edit'></span>Edit</a>" +
"<a class='k-button k-button-icontext k-grid-delete' href='Vendors/Delete/#= ID#'><span class='k-icon k-delete'></span>Delete</a>" +
"<a class='k-button k-button-icontext' href='Vendors/Details/#= ID#'>Details</a>")
.Title("")
.Width(240);
})
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.AllPages(true)
)
.Pageable(pager => pager
.PageSizes(new[] { 10, 20, 30, 50, 100 }) // Default page sizes are 5, 10 and 20
)
.Sortable(sortable => {
sortable.SortMode(GridSortMode.SingleColumn);
})
.Filterable()
.Events(e => e.DataBound("grid_dataBound"))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("Vendors_Read", "VendorGrid"))
.Destroy(destroy => destroy.Action("Vendors_Destroy", "VendorGrid"))
.Sort(sort => { sort.Add(vendor => vendor.CompanyName); })
)
)
@section Scripts {
<script>
$(document).ready(function () {
//Load grid settings from localstorage
var grid = $("#grid").data("kendoGrid");
var options = localStorage["kendo-grid-options"];
if (options) {
grid.setOptions(JSON.parse(options));
}
});
//Save grid settings so they can be reloaded later.
function grid_dataBound() {
var grid = $("#grid").data("kendoGrid");
localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
}
</script>
}
Hello,
I can find out why initial sorting does not work for:
var gridTest = $("#test-grid").kendoGrid({ dataSource: gridDataSource(actions.search.fixTest, 100), sortable: true, pageable: false, scrollable: true, filterable: true, selectable: "row", resizable: true, width: 700, height: 630, columns: [ { field: "Index", width: "60px" }, { field: "NR", width: "60px" }, { field: "Test", width: "400px" }, ], sort: { field: "Index", dir: "desc" }});Everything else works fine; clicking on the column header does sorting. But no initial sorting!
Any ideas?
Best regards,
Manu

So I have a dropdown list that initially populates with 10 values (the most common values for race) However, when the user starts typing, it searches the entire list of values(around 900) for a match. I didn't want load 900 values into a dropdown list so it uses server filtering and goes back to the server and searches for a match. I can select a race and this populates the dropdown list appropriately. However, if i reselect the dropdownlist, it loses the value, and only shows the initial 10. Is there a way where i can set the filter for the dropdown list to populate on click, so it will go to the server and bring back the match so it'll show that in the list and not lose its value?
@(Html.Kendo().DropDownListFor(m => m.Race.Id).OptionLabel("--Select--") .DataTextField("Description").Value(Model.Race.Id.ToString()).Text(Model.Race.Description).DataValueField("Id").HtmlAttributes(new { style = "width: 100%;", tabindex = "31" }).Filter("contains").DataSource(source =>{source.Read(read => { read.Action("GetRaceValueSet", "Person"); }).ServerFiltering(true); }) .AutoBind(false))Hi there,
I have encountered this problem and can not fix the filter for these two columns.
If I use filter for these two columns: EnrolledNumber and WaitListNumber, I will get
Internet Server Error
Invalid Property or Field - 'EnrolledNumber' for type: Class
If I disabled both sortable and filter for these two columns, everything else will work fine.
How can I make the filter work and at the same time the program will not lag or become ridiculously slow?
The following is my code.
Model
EnrolledNumber = model.ClientClasses.Where(i => i.IsActive == true).Count();WaitListNumber = model.ClientClasses.Where(i => i.IsActive == false).Count();
[Display(Name = "Enrolled")]public int EnrolledNumber { get; set; }[Display(Name = "WaitList")]public int WaitListNumber { get; set; }View
columns.Bound(i => i.EnrolledNumber).Width(90).Title("Enrolled");columns.Bound(i => i.WaitListNumber).Width(90).Title("WaitList");Controller
public ActionResult Read_Classes([DataSourceRequest] DataSourceRequest request, bool isCurrent, bool isPending, bool isFinished){ IQueryable<Class> items = DbContext.Classes.Where(i => i.IsActive); if (!isPending) items = items.Where(i => !i.Pending); if (!isFinished) items = items.Where(i => !i.Finished); if (!isCurrent) items = items.Where(i => i.Finished || i.Pending); return Json(items.ToDataSourceResult(request, i => new ClassListViewModel(i)));}I also get
An exception of type 'System.ArgumentException' occurred in Kendo.Mvc.dll but was not handled in user code
in Visual Studio for first time
Thank you
The RTM for ASP.NET Core is out.
There seem to be issues with the integration when calling the following method in the ConfigureServices method of the Startup class
services.AddKendo()
System.TypeLoadException
Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Hi,
I've a problem with filtering and sorting my grid. The Grid does not sort and filter my ViewModel-Properties.
View:
@(Html.Kendo().Grid<DepositModel>() .Name("gridClosedDeposits") .Columns(col => { col.Bound(p => p.Id) .Title(Resources.Resource.ID); col.Bound(p => p.DateTime) .Format("{0:dd.MM.yyyy hh:mm}") .Title(Resources.Resource.Date); col.Bound(p => p.User_Id) .Title(Resources.Resource.CustomerId); col.Bound(p => p.User.FirstName) .Title(Resources.Resource.FirstName); col.Bound(p => p.User.LastName) }) .Filterable() .Sortable() .Groupable() .Resizable(r => r.Columns(true) ) .Pageable(pageable => pageable .Refresh(true) .PageSizes(true) .ButtonCount(5)) .DataSource(dataSource => dataSource .Ajax() .Sort(sort => sort.Add("DateTime").Descending()) .Read(read => read.Action("GetClosedDeposits", "Grid")) .PageSize(10))GetClosedDeposits-Function:
public ActionResult GetOpenDeposits([DataSourceRequest]DataSourceRequest request){ using (var dbContext = new dbEntities()) { IQueryable<Deposit> deposits = dbContext .Deposit .Where(w => w.CanceledSmallDateTime == null && w.AccomplishedSmallDateTime == null); DataSourceResult result = deposits.ToDataSourceResult(request, s => new DepositModel { DateTime = s.DateTime, Id = s.Id, User_Id = s.User_Id, User = new UserModel { Id = s.User1.Id, FirstName = s.User1.FirstName.Split(' ')[0], LastName = s.User1.LastName, UserName = s.User1.UserName } } ); return Json(result); }}