This is a migrated thread and some comments may be shown as answers.

Filtering with custom column

4 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike Davis
Top achievements
Rank 1
Mike Davis asked on 14 Apr 2010, 06:57 PM
I am using a server side grid and trying to filter on a custom property.  The code below shows a property named "Type."  This is property for a class.  I am using a display template for one of its properties and when I try to filter nothing shows in the drop down list.  If I try to filter I get an object reference is null error.

Html.Telerik().Grid(Model)

.Name(

 

"Grid")

 

 

.DataKeys(keys => keys.Add(c => c.MiniatureId))

.DataBinding(dataBinding => dataBinding.Server()

.Select(

 

"Index", "Miniature"))

 

 

.Pageable(pager => pager.PageSize(15))

.Sortable()

.Scrollable(scrollable => scrollable.Height(450))

.Groupable(group => group.Enabled(

 

true))

 

 

.Filterable()

.Columns(columns =>

{

columns.Template(c =>

{

%>

 

 

<a href="<%=Url.Action("Edit", "Miniature", new {id = c.MiniatureId})%>">Edit</a>

 

 

&nbsp;

 

<a href="<%=Url.Action("Details", "Miniature", new {id = c.MiniatureId})%>">View</a>

 

 

<%

}).Width(80);

columns.Bound(c => c.Type).Width(100);

 

 

 

columns.Bound(c => c.Name).Width(200);

 

}).Render();

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Apr 2010, 08:36 AM
Hi Mike Davis,

Currently filtering is supported only for primitive types - numbers, dates, strings and enums. Unfortunately there is no way to perform filtering on custom type at the moment.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Fabien VORILLION
Top achievements
Rank 1
answered on 16 Jul 2010, 09:01 AM
Hi,

I am very interested in this feature.
For exemple, to use it at the same as the RadGrid (by templates) : http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx
Do you plan to integrate it into your next update ?

Regards,
Fabien Vorillion
0
Jann
Top achievements
Rank 1
answered on 17 Jan 2011, 09:13 AM
Any news on this?
What is the suggested work around? All ideas I've come up with so far are quite ugly since I also want to use editor templates... I think the way to go would be a feature that allows you to supply a lambda function that given the complex object returns a primitive type that will then be used for filtering.
0
Jann
Top achievements
Rank 1
answered on 09 Feb 2011, 10:15 AM
How much work would it be to use the result of ToString() to do filtering and sorting on complex objects. Grouping already works like this. Unfortunately this approach will not work with Linq to SQL or Linq to Entities directly. It will work if you call ToList() on the resulting IQueryable...

Is it correct that this issue can not even be sovled by using custom binding?
Tags
Grid
Asked by
Mike Davis
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Fabien VORILLION
Top achievements
Rank 1
Jann
Top achievements
Rank 1
Share this question
or