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

[Solved] Original and New row position after sorting

4 Answers 109 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.
Alfa
Top achievements
Rank 1
Alfa asked on 13 Nov 2009, 11:01 AM
Hi,

My grid is being populated by ObservableCollection IList.
If i change my column1 value, the column2 is also get changed.
I have implemented it by changing column2 value in ObservableCollection.
This works fine till i sort the grid.

if i sort on column1 and change the value of column1 in such a way that new value will make row to change it position.
them the new column2 value get updated in row which take place on the changed row.

eg
col1 col2
A     1
B     2
C     3

before sorting, if i make A1 to B1
col1 col2
B1   I m updated
B     2
C    3

but after sorting on col1, if i make A1 to B1
col1 col2
B      I m updated
B1   2
C    3

Now my question is, can i get old and new position of row, after sorting.
or if you can suggest some other solution.

Rdg
Alfa

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Nov 2009, 11:30 AM
Hello Alfa,

You can use Sorting and Sorted events to check desired new/old item position in the grid Items collection.

Kind regards,
Vlad
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.
0
Alfa
Top achievements
Rank 1
answered on 13 Nov 2009, 11:40 AM
How do i get those?
could you please provide example.
rgds
Alfa
0
Alfa
Top achievements
Rank 1
answered on 16 Nov 2009, 11:07 AM
Is it possible in Q2 2009 release?
Neither GridViewSortingEventArgs nor GridViewSortedEventArgs exposes any property like this.

Rgds
Alfa.
0
Vlad
Telerik team
answered on 16 Nov 2009, 12:20 PM
Hi,

I'm not sure if event arguments properties are related to this. The idea is to use Items collection (public property of the grid) to check desired item position before sorting and after sorting.

Sincerely yours,
Vlad
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
Alfa
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Alfa
Top achievements
Rank 1
Share this question
or