Welcome Guest Search | Active Topics | Sign In | Register

Locating a grid Options
ti-vam
Posted: Monday, July 30, 2012 7:54:42 PM
Rank: Member
Groups: Member

Joined: 6/4/2012
Posts: 13
How I can load a grid that is inside a TabStrip?

I tried with this

System.Web.UI.Control tabPageContent = null;

string tabPagePath = "DesempenoPorEvaluar.ascx";
tabPageContent = LoadControl(tabPagePath);
EO.Web.Grid grid = (EO.Web.Grid)tabPageContent.FindControl("GridDesempeno");

int nTot = grid.Items.Count;

but did not work. The control grid is found but no rows. The grid comes with no rows (nTot = 0).

thanks
eo_support
Posted: Tuesday, July 31, 2012 10:58:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Your code is correct. However if you want the Grid to retain its contents when you dynamically load the Grid, you must load the Grid at the very early stage of the page's life cycle before ViewState is being loaded, such as OnInit event. Page_Load event is too late for that.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.