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

[Solved] RadGridView / Sort

4 Answers 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
codeputer
Top achievements
Rank 2
codeputer asked on 12 May 2011, 04:39 AM
so I've added a record to an entity set that is bound to a radgridview.... I have the grid sorted on one column.  After the record was added, it shows up in the grid perfectly. I update the various fields, including the sort column.  How do I now sort the RadGridView again?  I've called Rebind, but that didn't do it.  Saves just fine too - where heck is the myGridView.Sort() method to force a sort!

Documentation on Rebind is not much help either - couldn't even find it...

Why are the simple things so hard!

Regards,
Richard

4 Answers, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 1
answered on 12 Aug 2011, 01:43 PM
Bump... Is there a way to do this? And is there a way to do this using MVVM?
0
Maya
Telerik team
answered on 15 Aug 2011, 07:35 AM
Hi,

I would recommend you to run through our online documentation and demos to check the sorting functionality of the RadGridView. There should be no problem to perform sorting if the data source collection implement either IComparable Interface or IEquatable Interface.

 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Matthew
Top achievements
Rank 1
answered on 15 Aug 2011, 04:10 PM
Hi -- I still couldn't get it to work. I'm not sure what needs to be IComparable / IEquatable as I'm setting the sort descriptor to be an integer. Please see the this demo solution (http://dl.dropbox.com/u/38266337/SLGridViewSorting.zip); when you fire it up and click the reorder link it becomes apparent that the rows do not reorder even when the SortOrder column changes.

Thanks for your help, Matthew
0
Maya
Telerik team
answered on 17 Aug 2011, 08:56 AM
Hi Matthew,

That would be the expected behavior since a property of the items is changed and no collection changed event is fired. What I may suggest to you is to take a  look at this blog post. Generally, it demonstrates how you may re-sort the grid when a change is performed.
Let me know whether the suggested approach corresponds to your requirements.

 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
GridView
Asked by
codeputer
Top achievements
Rank 2
Answers by
Matthew
Top achievements
Rank 1
Maya
Telerik team
Share this question
or