473,372 Members | 1,203 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 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 4440
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James | last post by:
I need to use the keyboard to scroll up/down my dtagrid. I need to map the 1. up/down arrow keys to move up/down one recored at a time 2. Page Up/Down keys to move up/down one page at a time...
2
by: James | last post by:
1. up/down arrow keys to move up/down one recored at a time 2. Page Up/Down keys to move up/down one page at a time 3. CTRL+End and CTRL+Home keys to move to end and beginning(last record and...
3
by: | last post by:
Hi, I have come across a situation which appears to be a BUG with the DataGrid control (asp:datagrid) Following the application of a fliter on a PostBack, it seems the total number of items...
3
by: Graeme | last post by:
Hello I'd like to call JS function from the ItemDataBound event to scroll datagrid down say 200px. Ideas please? Thanks Graeme
2
by: Dave | last post by:
Hello. How can I change DataGrid position at runtime (For example I want to move little down DataGrid control on the page)? Thank You.
1
by: jgrimsman | last post by:
I have a form with two DataGrid controls, each bound to different tables in a dataset. I would like to be able to have the user click a button, and have the currently highlighted row in datagrid1...
1
by: Claus Pedersen | last post by:
Hi Is it possible to 1: Move a row up/down serverside. Like myGridView.Rows.MoveUp() I can't find any way to do this. OR 2: Edit the datakey values on a GridViewRow. If I can do that I...
0
by: Hrvoje Voda | last post by:
I made my own control for moving text up and down within textbox. I don't want to use textbox propertie for scrooling text but my own. How to move text down or up ? Hrcko
4
by: Wernerh | last post by:
Hi could someone tell me where my code is incorrect? When I use the right arrow then the code works fine, when I try the down arrow it will not enter the figure and move 1 down. My code: If...
1
by: avisureshg | last post by:
Hi can anyone help me to figure out to do the scripts to move a record up/down pulled out from the database... i am new to php.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.