Drag and Drop Gridview Rows and updated Database using Live incoming data.

Last Reply 9 days ago By dharmendr

Posted 12 days ago

Hi,

Thanks again for helping me resolve issues with the Drag and Drop project in the past.

https://www.aspsnippets.com/questions/751482/Save-Insert-Drag-and-Drop-GridView-row-in-Log-Table-using-C-and-VBNet-in-ASPNet/

The drag and drop rows works great and users are loving the app!

The app is like a queue and is refreshed every 1 min.  It basically waits and updates items coming in from another system into the main items table that is displayed into the drag and drop gridview.

What I need to do is whenever a new row is added to the main list table, it needs to be added to the end no matter what the list position is. My data is constantly being updated via an SQL job every minute and new rows are added from another system to the main list table.

For example, if my main list items are 1-10 and a new row/item comes in, it should be added to the bottom of the list.  I should then end up with items 1-11.  Another example, If my list is 1-10 and a row is removed because it does not exist from the other system, let's say item #3 is no longer available, then when a new item comes in, it should go to the bottom and not replace #3 on the list.  Basically, when the gridview refreshes, it should update and re-order all rows accordingly but preserving the current postions/preference.

 For example, if my list is 1-10, and #3 is removed, now I have a list 1,2, 4,5,6,7,8,9,10.  I need all rows to move from #4 to #3 and #5 to #4 postions, etc...?  This needs to happen w/o user interraction because the gridview is adding and removing items every min.  Like i said this is a queue system.  Users only move/re-order items by drag and drop if they need to but not all the time.

Ho can I do this via SQL query?  Is this possible?

thanks for your help!

Gus

You are viewing reply posted by: dharmendr 9 days ago.
Posted 9 days ago

Please refer the below article. In this article update preference is implemented.

Reorder GridView Rows: Drag and Drop ordering of GridView Rows using jQuery in ASP.Net

Implement and let us know if any issue.