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

Custom Sort Grid using Sort descriptor vs. LINQ

3 Answers 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Umaa Krishnan
Top achievements
Rank 1
Umaa Krishnan asked on 16 Mar 2010, 06:43 AM
Hello,

I have the following questions for GridView (Incidentally I am using WCF Ria to populate my grid from SQL DB...
If that makes any difference to your response).

1) Does it make difference how you do custom sort, using descriptor vs. LINQ (I got it to work with Sort descriptor,
   for some reason not LINQ) in terms of performance, when you use paging etc.
2) In the newly released feature in Q1 2010, the page numbers are displayed. Is it possible to customize this. For example
   for orders, today's order on page 1, last week on page 2 (on page 2), etc?
3) Columns that are hidden are not available from gridview. Is there a way that this can be disabled?

Thanks

- Umaa
 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Mar 2010, 08:51 AM
Hi Umaa,

The correct (and easiest) way to use WCF RIA Services will be DomainDataSource since in this case the grid will work exactly in the same way as if the grid is bound to ICollectionView, IPagedCollection and IEditableCollectionView - when you use LINQ directly the grid will not know anything about what you have performed before assigning ItemsSource - the UI will not respond in any way.

You can check this blog post for more info about RadDataPager:
http://blogs.telerik.com/rossenhristov/posts/10-03-10/q1_2010_new_feature_paging_with_radgridview_for_silverlight_and_wpf.aspx

Can you elaborate a bit more on the last problem?

All the best,
Vlad
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
Umaa Krishnan
Top achievements
Rank 1
answered on 17 Mar 2010, 07:05 AM
Hello Vlad,

Let me try to clarify.
1) I am using using WCF RIA domainService to fetch data sorted by default criteria. But the user can change the criteria, and this requires custom sort, rather than using the default sort. So that is why my question. In this case, I need to do custom sort, as specified in your help docs (http://www.telerik.com/help/silverlight/gridview-sorting-custom.html). In this case I use SortDescriptors to achieve the custom sort instead of LINQ (because in my case it would not work with LINQ). So my question is, in this case,
 IS LINQ better than SortDescriptor? Or SortDescriptor better than using LINQ? Or  it does not matter?
2) I had checked out Rossen Hristovs' blog, as well as the demo. But that does not answer my question. What I would to know is that is it possible to page logically. For example if I have 1000 rows, and instead of it being on 10 pages, I want these pages to be logical. such that one page may have 50 rows, and another page may have 150 rows. For example each page, containing customers in a geographic zone. Alternatively, if it is possible to have the have a tool tip kind of behavior, such that when I click on the page, I have some idea of the contents (maybe display the last row contents.)
3) What I meant was is there a way that I can disable 'HORIZONTAL' virtualization
.

Thanks

- Umaa
0
Stefan Dobrev
Telerik team
answered on 19 Mar 2010, 12:41 PM
Hi Umaa,

Please find my answers in order:
  1. It doesn't matter how you will decide to implement the custom sorting, it is up to you to choose the best method that will fit for your scenario. By the way SortDescriptors are using LINQ internally to perform the sorting operation.
  2. It is definitely possible to implement logical paging. You just have to implement IPagedCollectionView interface and pass this implementation as Source of the RadDataPager. We will be blogging about this topic in the future so stay tuned.
  3. If you want to disable horizontal virtualization you have to set the EnableColumnVirtualization property to false.

Kind regards,
Stefan Dobrev
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.
Tags
GridView
Asked by
Umaa Krishnan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Umaa Krishnan
Top achievements
Rank 1
Stefan Dobrev
Telerik team
Share this question
or