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

Sorting on GridViewColumnComboBox

3 Answers 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
jbaird
Top achievements
Rank 1
jbaird asked on 16 Jul 2009, 02:29 PM

I have the following definition:

<
bfgs:bRadGridViewComboBoxColumn UniqueName="colAccountPeriod"

                                 HeaderText="Account Period"

                                 IsReadOnly="False"

                                 DataMemberBinding="{Binding FK_AccountPeriod, Mode=TwoWay}"

                                 DisplayMemberPath="AccountPeriodEnd"

                                 SelectedValueMemberPath="AccountPeriodKey"

                                 IsSortable="True" />


However, it seems that the sorting sorts by FK_AccountPeriod and not the Display value.  Is there a way to change this?  I would like the dates in the DisplayMemberPath to be sorted on the header click, not the underlying FK.

Thanks..

 

 

 

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 17 Jul 2009, 11:50 AM
Hello jbaird,

We are still working on the automatic support of sorting by DisplayValue. However this one is still in progress. The workarround is to use the custom sorting function of the RadGridView.

What you need to do is to handle the Sorting event of RadGrid view and perform your own sorting logic within. Something like :
 private void radGridView1_Sorting(object sender, GridViewSortingEventArgs e)  
        {  
 
            if (e.SortingState == SortingState.None)  
            {  
                e.SortingState = SortingState.Ascending;  
        //place here your own code to sort the itemssource collection  
            }  
            else if (e.SortingState == SortingState.Ascending)  
            {  
                e.SortingState = SortingState.Descending;  
                //place here your own code to sort the itemssource collection  
            }  
            else 
            {  
                e.SortingState = SortingState.None;  
                //place here your own code to "un-sort" the itemssource collection  
            }  
 
                         
            e.Cancel = true;  
        } 


Kind regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Scott Rakestraw
Top achievements
Rank 1
answered on 30 Nov 2009, 05:02 PM
Is there any update as to when we can expect this feature to be implemented?
0
Pavel Pavlov
Telerik team
answered on 03 Dec 2009, 11:19 AM
Hello Scott ,

We are still working on this one.  Since display values are typically extracted through a lookup operation over a collection different than the RadGridView.ItemsSource it  appears to be a  heavy and non trivial task. There are big performance related  challenges we still need to solve before releasing it as an integrated feature.

I believe the earlier release that  may have this integrated is Q1 2010.

Sincerely yours,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
jbaird
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Scott Rakestraw
Top achievements
Rank 1
Share this question
or