As you said, if you want to store it at session, you can create a class like this:
public class Class1
{
public static DataTable TableSession
{
get
{
if (HttpContext.Current.Session["dt"] == null)
{
DataTable dt = new DataTable();
dt.Columns.Add("checked");
dt.Columns.Add("name");
HttpContext.Current.Session["dt"] = dt;
}
return (DataTable)HttpContext.Current.Session["dt"];
}
set
{
HttpContext.Current.Session["dt"] = value;
}
}
}
and access it anywhere like this:
protected void Page_Load(object sender, EventArgs e)
{
sourcegridview.DataSource = Class1.TableSession;
sourcegridview.DataBind();
Class1.TableSession.Rows.Add("1", "new data");
CompiledGridview.DataSource = Class1.TableSession;
CompiledGridview.DataBind();
}