471,350 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

how to move a row in datagrid up or down?

how to move a row in datagrid up or down?

Regards.
wu jianhua
Jan 18 '06 #1
2 4335
wu,

You can't really do this. You don't move rows in the data grid. What
you have to do is order the items in the source of data so that they are
ordered appropriately.

For data tables, this is the sort order on the DefaultView property, or,
if it is a DataView class itself, it is the sort property on that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wu jianhua" <bi*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
how to move a row in datagrid up or down?

Regards.
wu jianhua

Jan 18 '06 #2
If you did want to do this then you would need to remove the row from the
underlying collection (Datatable, dataview, ilist) and insert it in the new
location.

It isn't a good idea for datasets that you are going to use to update you
database again as I think it might try and delete the row and then re-add it
to your database table.

For bound object collections it probably isnt a crime though

Ciaran
"wu jianhua" <bi*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
how to move a row in datagrid up or down?

Regards.
wu jianhua

Jan 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by James | last post: by
2 posts views Thread by James | last post: by
3 posts views Thread by | last post: by
3 posts views Thread by Graeme | last post: by
2 posts views Thread by Dave | last post: by
1 post views Thread by jgrimsman | last post: by
1 post views Thread by Claus Pedersen | last post: by
reply views Thread by Hrvoje Voda | last post: by
4 posts views Thread by Wernerh | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.