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

Sort By Property Not Bound to a Column

3 Answers 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 01 Sep 2020, 03:47 PM

Hello! 

I'm trying to figure out how to get the contents of my grid to sort by a property member that is not exposed to the UI via a column. The item source for my grid comes from a collection view defined on my ViewModel. This collection view has sort descriptors defined in C#, one of which is to sort by a boolean property that is not bound to a column on the grid, but that sort descriptor is not honored at run-time. 

 

Any assistance is appreciated.

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 04 Sep 2020, 10:57 AM

Hello Alex,

I tried to replicate the setup you described in a small sample project, however, the sort descriptor I've applied to the collectionview is respected at my end even though it does not correspond to a column bound to the RadGridView control.

Can you please have a look at the attached project and let me know if I'm missing something of importance? I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Alex
Top achievements
Rank 1
answered on 04 Sep 2020, 05:48 PM

Thank you for your reply. Unfortunately, I must confess that my problem was more fundamental than I originally believed, and I feel pretty stupid about it. 

Apparently, sorting by a boolean value did not behave as I thought it would. I was having my code sort in descending order thinking "true" values would be on top, but that is not the case. I apologize for this misunderstanding. My problem has been solved. 

0
Dilyan Traykov
Telerik team
answered on 08 Sep 2020, 06:55 AM

Hi Alex,

No reason to apologize or be ashamed, such things happen to all of us.

I'm happy to hear that you've managed to resolve your issue. Please let me know if I can further assist you with anything else.

Regards,
Dilyan Traykov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
GridView
Asked by
Alex
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Alex
Top achievements
Rank 1
Share this question
or