Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
Hi all,
can any body tell me how can I get the gridveiw datasource after post back

tx in advance
Posted

Hi @Code_Seeker

why don't you use the sesison variable.
C#
gridview1.datasource=datatable;
gridview1.databind();

session["storedatatable"]=datatable;

that can have the ability to store the data after the post back control


Hope it will help you

Thanks
 
Share this answer
 
v2
Hi ,
it's easy just try this one .
C#
protected void Button1_Click(object sender, EventArgs e)
{
    DataTable dty =(DataTable) GridView1.DataSource;
}


Best Regards
M.Mitwalli
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900