My Question is that : " I have a grid view in which there are 6 columns , last 2 columns are EDIT and DETAILS . Now i also have a PRINT Button outside the DATAGRID , what i want is that , when a user clicks on that Print Button, My Last 2 columns Edit and Details got hide, then the print window appears , then user will click on either Print or Close that window (if he wish to) . after that print window closes or being closed by a user ,then, that 2 columns which i hide when the PRINT btn was clicked , now gets visible ... so far i have tried this code , i am successful only in hiding the last two columns and not showing them in print preview , BUT ! after that print window is closed , my hided columns are not showing again .... i have to reload my page manually by pressing CTRL + F5 ... how to achieve this task ? I want to show those columns again ... Please help me ... here's my code on PRINT BTN CLICK EVENT ....
protected void PrintBTN_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
row.Cells[5].Visible = false;
row.Cells[6].Visible = false;
GridView1.Columns[5].Visible = false;
GridView1.Columns[6].Visible = false;
StringBuilder sb = new StringBuilder();
sb.Append("");
ScriptManager.RegisterClientScriptBlock(this, GetType(), "GridPrint", sb.ToString(), false);
}
}

Anubhav ChaudharyPosted Feb 25, 2014, 2:03 AM
You can check my article I had used the same functionality:
http://www.c-sharpcorner.com/UploadFile/cd7c2e/how-to-auto-refresh-grid-view-on-closing-of-popup-menu/
Posted Feb 24, 2014, 9:21 AM
http://stackoverflow.com/questions/2301278/refresh-parent-window-when-closing-child-window
http://stackoverflow.com/questions/17460879/how-to-refresh-parent-page-on-closing-of-pop-up-window
Emad khanPosted Feb 24, 2014, 9:01 AM
KalaiPosted Feb 24, 2014, 8:34 AM
http://stackoverflow.com/questions/17779973/refresh-a-asp-net-page-on-button-click