Introduction
Here I will explain how to move or transfer selected checkbox gridview rows to another gridview in asp.net using c#, or copy one gridview row to another gridview in asp.net using c#.
After
that add following code in code behind
Here I will explain how to move or transfer selected checkbox gridview rows to another gridview in asp.net using c#, or copy one gridview row to another gridview in asp.net using c#.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tranfer selected gridview rows to another gridview in
Asp.net</title>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:GridView ID="gvDetails"
AutoGenerateColumns="false"
CellPadding="5"
runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect"
runat="server"
AutoPostBack="true"
OnCheckedChanged="chkSelect_CheckChanged"
/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="UserId" DataField="UserId" />
<asp:BoundField HeaderText="UserName" DataField="UserName" />
<asp:BoundField HeaderText="Education" DataField="Education" />
<asp:BoundField HeaderText="Location" DataField="Location" />
</Columns>
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" />
</asp:GridView>
<br />
<b>Second Gridview Data</b>
<asp:GridView ID="gvTranferRows"
AutoGenerateColumns="false"
CellPadding="5"
runat="server"
EmptyDataText="No
Records Found">
<Columns>
<asp:BoundField HeaderText="UserId" DataField="UserId" />
<asp:BoundField HeaderText="UserName" DataField="UserName" />
<asp:BoundField HeaderText="Education" DataField="Education" />
<asp:BoundField HeaderText="Location" DataField="Location" />
</Columns>
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" />
</asp:GridView>
</div>
</form>
</body>
</html>
|
Now
add following namespaces in codebehind
C# Code
using System;
using System.Data;
using System.Web.UI.WebControls;
|
|
Is There any mechanism by which i can do it on client side
ReplyDelete