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

Shuffling rows in Gridview

1 Answer 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gowtham
Top achievements
Rank 1
Gowtham asked on 20 Apr 2012, 08:04 AM
I have radgrid for which I have binded data from code behind, I have two buttons next to my grid control, one moveup button and movedown button. On selecting a particular row on the grid and on click of moveup button I have to move the row up. How do I exchange the rows?

1 Answer, 1 is accepted

Sort by
0
Accepted
Elliott
Top achievements
Rank 2
answered on 20 Apr 2012, 03:19 PM
bind the grid to a data source upon initial entry - and store that data source
sort and key the grid on a generated number
when the flip columns command is issued, swap the generated keys of the row - and rebind

does the grid also update? 
Tags
Grid
Asked by
Gowtham
Top achievements
Rank 1
Answers by
Elliott
Top achievements
Rank 2
Share this question
or