Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:39:36+00:00 2026-06-12T22:39:36+00:00

I am using asp.net (3.5). I have GridView and I need to use Drag&Drop

  • 0

I am using asp.net (3.5). I have GridView and I need to use Drag&Drop for purpose to reorder items (table rows) and save new order to db.

I have found out that I can use jquery.tablednd plugin for this purpose.

DnD functionality really works for me, but I cannot reorder items and save in db, because ON DROP never works for me.

I have tried to copy different examples I found in web, but ondrop never works for me. I have created new file to do tests (my original page uses masterpage).
I have included ajaxToolkit:ToolkitScriptManager , but I have also tried it with asp:ScriptManager.
DropAndDrag is working, but ON DROP event is never called. OnDragStart event is called successfully.
Please, have a look to my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="News.aspx.cs" Inherits="Tutelaconnect.News" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.js" type="text/javascript"></script>
<script src="http://www.isocra.com/articles/jquery.tablednd.js" type="text/javascript">  
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#<%= GridViewSample.ClientID %>").tableDnD({
            onDrop: function (table, row) {
                alert('1');                    ///// THIS NEVER HAPPEN
            },
            onDragStart: function (table, row) {
                // alert('2');  //// THIS HAPPENS
            }
        });
    });        
</script>
</head>
<body>
<form id="form1" runat="server">
 <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<div id="debugArea">
</div>
<div class="tableDemo">
    <asp:GridView ID="GridViewSample" runat="server" AutoGenerateSelectButton="false"
        AutoGenerateColumns="false" Width="800px">
        <Columns>
            <asp:TemplateField HeaderText="C">
                <ItemTemplate>
                    <asp:TextBox ID="TextBoxC" runat="server" Text='<%# Eval("C") %>' Width="50px" />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="10em" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="A">
                <ItemTemplate>
                    <asp:Label ID="LabelA" runat="server" Text='<%# Eval("A") %>' />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="30em" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</div>
</form>
</body>
</html>

I am really stuck. Do not know how to continue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:39:38+00:00Added an answer on June 12, 2026 at 10:39 pm

    I found the solution here: http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/comment-page-15/#comment-3460

    Basically, each row in your table needs an Id, you can use code like this to give them one:

    var i = 0;
    $("#<%= GridViewSample.ClientID %>").find('tr').each(function() {
        $(this).attr('id', i++);
    });
    

    I placed this code right before: $("#<%= GridViewSample.ClientID %>").tableDnD and was able to get the alert(1); box displaying each time I dropped a row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using C# ASP.NET on VS2005. I have a gridview table but it
Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I have an ASP.NET(2.0 using C#) web app, in which I have a gridview.
I need to implement the following in the asp.net Gridview. I have the excel
I have an ASP.NET gridview I want to manipulate using JavaScript/JQuery. The problem I
I have asp.net app where I am using gridview for data showing, editing and
i'm loosing my mind. Using ASP.NET in a GridView, amongst other controls, I have
I have asp.net page where I am using a gridView with custom paging and
sending mail along with embedded image using asp.net I have already used following but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.