This way
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script>
<link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" />
<script type="text/javascript">
var index = -1;
$(function () {
$(".drag_drop_grid").sortable({
items: 'tr:not(tr:first-child)',
cursor: 'crosshair',
axis: 'y',
dropOnEmpty: false,
start: function (event, ui) {
index = ui.item.index();
}
});
});
$("[id*=DetailsView1]").live("mouseover", function () {
var row = $(".drag_drop_grid tr").eq(index);
index = -1;
$("[id*=DetailsView1] .item").html(row.find(".item").html());
$("[id*=DetailsView1] .price").html(row.find(".price").html());
});
</script>
<style type="text/css">
.GridSrc td
{
background-color: #A1DCF2;
color: black;
font-size: 10pt;
font-family: Arial;
line-height: 200%;
cursor: pointer;
width: 100px;
}
.GridSrc th
{
background-color: #3AC0F2;
color: White;
font-family: Arial;
font-size: 10pt;
line-height: 200%;
width: 100px;
}
.GridDest td
{
background-color: #eee !important;
color: black;
font-family: Arial;
font-size: 10pt;
line-height: 200%;
cursor: pointer;
width: 100px;
}
.GridDest th
{
background-color: #6C6C6C !important;
color: White;
font-family: Arial;
font-size: 10pt;
line-height: 200%;
width: 100px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="gvSource" runat="server" CssClass="drag_drop_grid GridSrc" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Item" HeaderText="Item" ItemStyle-CssClass="item" />
<asp:BoundField DataField="Price" HeaderText="Price" ItemStyle-CssClass="price" />
</Columns>
</asp:GridView>
<hr />
<asp:DetailsView CssClass="GridDest" ID="DetailsView1" runat="server"
Height="50px" Width="125px" AutoGenerateRows="false">
<Fields>
<asp:BoundField DataField="Item" HeaderText="Item" ItemStyle-CssClass="item" />
<asp:BoundField DataField="Price" HeaderText="Price" ItemStyle-CssClass="price" />
</Fields>
</asp:DetailsView>
<%-- <asp:GridView ID="gvDest" runat="server" CssClass="drag_drop_grid GridDest" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Item" HeaderText="Item" />
<asp:BoundField DataField="Price" HeaderText="Price"/>
</Columns>
</asp:GridView>--%>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Item"), new DataColumn("Price") });
dt.Rows.Add("Shirt", 450);
dt.Rows.Add("Jeans", 3200);
dt.Rows.Add("Trousers", 1900);
dt.Rows.Add("Tie", 185);
dt.Rows.Add("Cap", 100);
dt.Rows.Add("Hat", 120);
dt.Rows.Add("Scarf", 290);
dt.Rows.Add("Belt", 150);
gvSource.UseAccessibleHeader = true;
gvSource.DataSource = dt;
gvSource.DataBind();
dt.Rows.Clear();
dt.Rows.Add();
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
}
}