Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 24th, 2007, 09:13 AM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Move Datagrid rows

I need to give my users the option of reordering individual rows in a datagrid. They should be able to move one row up or down in the Datagrid with the change in positioning saved back to the database via an ID field.

I'm completely stumped on how to begin this. Does anyone have any suggestions or sample code? This project is using VB.NET.

Thanks in advance for any help!
  #2 (permalink)  
Old April 24th, 2007, 05:31 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

OK. Here's a start. First I have an OrderID column in the database. When I post the datagrid I have a template column that puts images of up and down arrows in the column. The top selection does not have an up arros and the last row does not have a down arrow. I have functions OrderUp and OrderDown that reorder the OrderID's for the selected row and either adding or subtracting one to the OrderID and either subtracting or adding one to either the row above or row below depending on whether you're moving up or down.

There are other alternate ways of doing this depending on your exact requirements.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move rows in a table bucky483 Javascript How-To 10 March 27th, 2017 12:57 AM
move next rows in DataGrid < > prop. not correct fbailey ASP.NET 1.0 and 1.1 Basics 3 September 5th, 2007 10:17 AM
Moving rows up and Down in Datagrid Baby_programmer ASP.NET 1.0 and 1.1 Professional 5 August 20th, 2006 04:14 AM
rows in Datagrid drachx General .NET 0 October 20th, 2004 08:02 PM
move rows to top with cells in columnA filled RED alienscript Excel VBA 2 December 2nd, 2003 12:51 PM

All times are GMT -4. The time now is 01:07 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.