jQuery comes with a number of handy plugins to enhance the functionality of web controls. In user interactive applications, where there is a need to shuffle the rows of a GridView, we will see how we can apply a jQuery plugin to accomplish the task on the client without the need of a server-side refresh.
Add a new form
Recipe4.aspx
to the current project.Download the jQuery Drag and Drop plugin available from http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/.
Save the plugin file to the script folder
js
in the project as shown in the following screenshot:Include the jQuery library as well as the plugin on the page:
<script src="js/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.tablednd_0_5.js"></script>
Add a GridView control to the form. Populate data to the control as described earlier in the chapter. Thus, the web form contents are as follows...