By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,890 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,890 IT Pros & Developers. It's quick & easy.

moving rows in dataset

P: n/a
Sam
Hi,
I have a datagrid which datasource is a dataset.
I want to add a spin button to my form so that when the user click on
the up arrow, the selected row in the grid will be moved up by one
(same if the user click the down arrow). Has anybody done that before ?
Is it possible ? It seems quite hard, is the changes made to the
dataset going to be reflected to the grid ?
Thx

Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

Maybe this will help
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q832q

Ken
-------------------
"Sam" <sa**************@voila.fr> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I have a datagrid which datasource is a dataset.
I want to add a spin button to my form so that when the user click on
the up arrow, the selected row in the grid will be moved up by one
(same if the user click the down arrow). Has anybody done that before ?
Is it possible ? It seems quite hard, is the changes made to the
dataset going to be reflected to the grid ?
Thx
Nov 21 '05 #2

P: n/a
Sam
no it doesnt ;)
I'm not using the microsoft datagrid... Anyway i've solved my problem
with this thread :

http://groups.google.co.uk/group/mic...97a433ff6f0df2

Thx

Nov 21 '05 #3

P: n/a
Sam,

You asked for a simple way.

When you want to use a difficult way, than I would use an extra datacolumn.
Loop in that a rownumber, set the defaultview on that, and swap the numbers.

And then use gridstyles to show the columns you want to show in the
datagrid.

Just my idea not tested,

Cor
Nov 21 '05 #4

P: n/a
Sam
sounds good. But I still prefer the method in the thread which i gave
the link above, it's more generic and easy to reuse for any grid.

thx

Nov 21 '05 #5

P: n/a
Sam,
sounds good. But I still prefer the method in the thread which i gave
the link above, it's more generic and easy to reuse for any grid.

Now I see it, I thought he was swapping the rows, however he is swapping the
data inside it I see now. A clever method yes.

However, when you use this dataset to update, take than care by the way of
the rowstates because this will set now both swapped rows to changed and I
don't know if that is your goal. I assume that you can get as well get some
trouble with new rows or with rows with a rowstate deleted when those exist
in the dataset.

Cor
Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.