Welcome Guest Search | Active Topics | Sign In | Register

Problems loading a grid externally Options
DTU
Posted: Tuesday, June 29, 2010 3:06:59 AM
Rank: Advanced Member
Groups: Member

Joined: 5/19/2010
Posts: 35
Hi,

I currently have a searchgrid object which dynamically generates a grid object based on the search entered. Internally this is working fine, however I'm now trying to allow the various properties and methods working externally - Everything seems to be working fine as-is except for actually loading the grid externally: The contents of the grid disappear when put into edit mode.

HOWEVER, if the grid is loaded on !this.IsPostBack on the prerender or page_load (IE, it works fine. Here's what I've got:

Code: C#
private string _command;

    public string Command
    {
        get { return this._command; }
        set { this._command = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
	{

    }
    
    protected void Page_PreRender(object sender, EventArgs e)
    {
        ASP.RiskProfilesSearchGrid SearchControl = this.RiskProfilesSearchGrid;
        EO.Web.Grid searchGrid = this.RiskProfilesSearchGrid.LocalGrid;
        EO.Web.Grid resultsGrid = null;

        if (!this.IsPostBack)
        {
            SearchControl.PerformSearch();
//If only loaded here, no problems are encountered
        }
        
        
        if (this.RiskProfilesPagePanel.IsCallbackByMe)
        {
            if (Command == "Load")
            {
                SearchControl.PerformSearch();
//However if loaded here, the results disappear as soon as editmode is entered...
            }
            else if (Command == "Edit")
            {          
                RiskProfilesSearchGrid.TabPageContent.InEditMode = true;
            }
            else if (Command == "Save")
            {               
                RiskProfilesSearchGrid.TabPageContent.SaveChanges();
            }
        }
        else
        {
            resultsGrid = this.RiskProfilesSearchGrid.LocalResultsGrid;
        }
    }

    protected void ExternalLoad(object senter, EventArgs e)
    {
        Command = "Load";
    }

    protected void ExternalEdit(object sender, EventArgs e)
    {
        Command = "Edit";
    }

    protected void ExternalSave(object sender, EventArgs e)
    {
        Command = "Save";
    }


The aspx page contains the searchgrid, a callback and three buttons as triggers. Is there something obvious I'm missing here?
eo_support
Posted: Tuesday, June 29, 2010 7:45:36 AM
Rank: Administration
Groups: Administration

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

Please try to perform your search before Page_PreRender. The Grid also performs a number of tasks inside PreRender. So performing the search inside PreRender may be too late.

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.