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

Double bound column OrderBy bug

0 Answers 11 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.
Alex
Top achievements
Rank 1
Alex asked on 24 Apr 2012, 09:41 PM
There seems to be sorting bug in the following scenario:
 - two columns bound to the same viewmodel property
 - sort by MultiColumn

I binded 2 columns to the same viewmodel property to get a checkboxes column as in this example: http://demos.telerik.com/aspnet-mvc/razor/grid/checkboxesajax

after I sort on the value displaying column I use the Telerik provided this.GridRouteValues() to get the grid properties.  The old OrderBy value remains and the new value is appended.  The resulting value looks like the following:

MyPropertyName-asc~MyPropertyName-desc

As you can see, the same column is being sorted twice, which creates serious problems down the road.  I was able to work around this bug by creating another property in my viewmodel just for binding for checkboxes like so:

public long PropertyForCheckbox { get { return MyPropertyName; } }

Just wanted to bring it to Telerik's attention.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Share this question
or