3 Answers, 1 is accepted
0
Hello Brett,
You can do this however you need to provide dataSource for the filterable configuration.
e.g.
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.dataSource
Kind Regards,
Petur Subev
Telerik
You can do this however you need to provide dataSource for the filterable configuration.
e.g.
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.dataSource
Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brett
Top achievements
Rank 1
answered on 23 Mar 2015, 03:13 PM
I tried this but it didn't get the unique value of the dataSource. Values were repeated.
Is this the expected behavior?
Is this the expected behavior?
0
Hello Brett,
Yes, the built-in dataSource that is generated cannot be sorted, so you need to provide your own dataSource where you should also take care to show only unique values.
We have a demos that show how to provide unique values when using the different MVC wrappers. Here is an example from the .NET framework
Kind Regards,
Petur Subev
Telerik
Yes, the built-in dataSource that is generated cannot be sorted, so you need to provide your own dataSource where you should also take care to show only unique values.
We have a demos that show how to provide unique values when using the different MVC wrappers. Here is an example from the .NET framework
using System.Collections.Generic;using System.Linq;using System.Web.Mvc;using Kendo.Mvc.Examples.Models;using Kendo.Mvc.Extensions;using Kendo.Mvc.UI;using System.Reflection;namespace Kendo.Mvc.Examples.Controllers{ public partial class GridController : Controller { public ActionResult Filter_Multi_Checkboxes() { return View(); } public ActionResult Unique(string field) { var result = GetEmployees().Distinct(new EmployeeComparer(field)); return Json(result, JsonRequestBehavior.AllowGet); } } public class EmployeeComparer : IEqualityComparer<EmployeeViewModel> { private string field; private PropertyInfo prop; public EmployeeComparer(string field) { this.field = field; prop = typeof(EmployeeViewModel).GetProperty(field); } public bool Equals(EmployeeViewModel x, EmployeeViewModel y) { return prop.GetValue(x, null).Equals(prop.GetValue(y, null)); } public int GetHashCode(EmployeeViewModel obj) { return prop.GetValue(obj, null).GetHashCode(); } }}Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!