This question is locked. New answers and comments are not allowed.
William Brown
Top achievements
Rank 1
William Brown
asked on 09 Sep 2010, 10:21 PM
I have checkbox column in a grid and want the uses to be able to sort if it's checked or not. Is there a way to use a gridbuilder type on the grid to be able to allow sorting on that column?
4 Answers, 1 is accepted
0
Hello William Brown,
Georgi Krustev
the Telerik team
I will suggest you examine this online demo, which shows how to sort column with boolean type.
All the best,Georgi Krustev
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
William Brown
Top achievements
Rank 1
answered on 09 Sep 2010, 10:42 PM
But can you sort on a template colum?
our column is a template column that toggles and saves the value. This removes the sort on that column. Can you sort on a template column like this? I couldn't see how in the link you suggest I look at. thanks Georgi
columns.Template(o => { %> <input type="checkbox" id="IsLockedOut" name="IsLockedOut" <% if (o.IsLockedOut) { %> checked="checked" <%} %> onclick="OnLockedOutToggle('<%= o.UserName %>')" /> <% }) .Width(30) .Title("IsLockedOut") .HtmlAttributes(new { align="center" });0
Accepted
Hello William Brown,
In the way how the column is declared, grid does not know on which property to sort. In order to achieve your goal you need to add Bound column with server template:
All the best,
Georgi Krustev
the Telerik team
In the way how the column is declared, grid does not know on which property to sort. In order to achieve your goal you need to add Bound column with server template:
columns.Bound(o => o.IsLockedOut) .Template(x => { %> <input type="checkbox" id="IsLockedOut" name="IsLockedOut" <% if (o.IsLockedOut) { %> checked="checked" <%} %> onclick="OnLockedOutToggle('<%= o.UserName %>')" /> <% }) .Width(30) .Title("IsLockedOut") .HtmlAttributes(new { align="center" });All the best,
Georgi Krustev
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
William Brown
Top achievements
Rank 1
answered on 10 Sep 2010, 05:09 PM
Thanks Georgi!
Works perfectly. I had to change o. to x. under the template if statements, but it is what we were looking for.
Bill
Works perfectly. I had to change o. to x. under the template if statements, but it is what we were looking for.
Bill