Hi,
I have the detail in the grid view with check box . When i select some rows and click on show it should be displayed in another grid view with the check box, simultaneously selected rows should be removed from the first grid. But i didn't get a proper solution. Please help me if any one know about my doubt please......


Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 2:52 AM EDT
Anurag SarkarRank #1,049 · 1.8K reputationPosted Sep 8, 2015, 10:44 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 2:24 AM EDT
Linto P Thomas20 reputationPosted Sep 9, 2015, 2:50 AM EDT
Linto P Thomas20 reputationPosted Sep 9, 2015, 2:51 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 2:53 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 2:54 AM EDT
Linto P Thomas20 reputationPosted Sep 9, 2015, 3:33 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 3:36 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 9, 2015, 3:45 AM EDT
///
/// Export to Excel
///
/// Gridview Name
/// File Name
public static void ExportToExcel(System.Web.UI.WebControls.GridView gv,string FileName)
{
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader("content-disposition",string.Format("attachment; filename={0}","" + FileName + ".xls"));
HttpContext.Current.Response.ContentType = "application/ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gv.AllowPaging = false;
gv.RenderControl(htw);
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();
}
///
/// Export to Excel without VerifyRenderingInServerForm
///
/// Gridview Name
/// File Name
public static void ExportToExcelNewFrm(System.Web.UI.WebControls.GridView gv,string FileName)
{
string style = @" ";
HttpContext.Current.Response.ClearContent();
// Create form tag
System.Web.UI.HtmlControls.HtmlForm form1 = new System.Web.UI.HtmlControls.HtmlForm();
gv.AllowPaging = false;
form1.Controls.Add(gv);
HttpContext.Current.Response.AddHeader("content-disposition",string.Format("attachment; filename={0}","" + FileName + ".xls"));
HttpContext.Current.Response.ContentType = "application/ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
System.IO.StringWriter header = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gv.RenderControl(htw);
// Style is added dynamically
HttpContext.Current.Response.Write(style);
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();
}