We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Update ItemSource on Sort

Hi,

I am using GridDataControl and I'd like to know if it possible to keep the ItemSource sorted like it's displayed.

In my case, when I delete a row from the sorted data I want the CurrentRow to stay at the same position, but actually that's not it. 

Maybe this exemple will help you understand my problem

ItemsSource (a ObservableCollection) :
One
Two
Three
Four

GridDataControl displayed data (sorted alphabetically):
Four
One
Three
Two

If the current item is Three and I delete it, then I want the CurrentItem to stay at the same position (wich should be Two) but instead the CurrentItem will be Four.


3 Replies

SM Saravanan M Syncfusion Team September 3, 2013 12:35 PM UTC

Hi Jean,

We have analysed the reported issue with our sample; but we are not able to reproduce the issue. Can you please revert us by modifying the sample based on your application along with the replication procedure. This would be helpful for us to serve you.

Could you please share the product version details with us?

Please find the attached sample below.

Please let us know if you have any queries.

Regards,

Saravanan.M



GridDataControl_sample_sort_bbbbcd60.zip


JM JEAN MICHEL CAMIZON September 17, 2013 07:31 AM UTC

Hi,

Thank you for yout answer it helped me, but I figured I was missing something else too.
It was because I didn't turn off the sort when editing.

Thank you again.


GA Gobinath A Syncfusion Team September 26, 2013 09:46 AM UTC

Hi Jean,

 

Sorry for the  delay to getting back to you.

 

We have analyzed your query and you can disable the sorting operation while editing by using the SortingOptions API as below code snippet.

Code snippet[XAML]:

<syncfusion:GridDataControl x:Name="dataGrid1"

     ItemsSource="{Binding ProductInfo}"

     SortingOptions="DisableSortingOnEdit">

Please let us know if you have any queries.

Regards,

Gobinath A.


Loader.
Live Chat Icon For mobile
Up arrow icon