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?