connectseekers.com

Saturday, 16 August 2014

Draggable GridView Using jQuery in Asp.Net

8/16/2014 - By Pranav Singh 0

This article will show you how you can create a new draggable gridview using jQuery and bind by using accessdatasource in asp.net. By this article you will be able to move your gridview in anywhere in browser.


So for this article first we will create a new asp.net application and add the below code into your page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridViewByDataSource.aspx.cs"
    Inherits="ProjectDemo_Asp.et.GridViewByDataSource" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Draggable GridView Using jQuery and Bind By Using AccessDataSource in Asp.Net | Movable GridView Using jQuery in Asp.net</titvle>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
    <style>
        #divdraggable
        {
            width: 250px;
            height: 150px;
            padding: 0.5em;
        }
    </style>
    <script>
        $(function () {
            $("#divdraggable").draggable();
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divdraggable">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1"
            EmptyDataText="There are no data records to display." Width="250px">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:BoundField DataField="Marks" HeaderText="Marks" SortExpression="Marks" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="App_Data\bookstore.mdb"
            SelectCommand="SELECT `Id`, `Name`, `Address`, `Marks` FROM `Student`"></asp:AccessDataSource>
    </div>
    </form>
</body>
</html>

In this article I have used the AccessDataSource to bind the gridview. In this please check the below code to perform dragable operation.

Now we have done run the page to check the output.


 DOWNLOAD

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top