Hi Expert!
I would like to populate a Gridview which is inside an update panel on button click. Currently the gridview is getting populated however doesn't show up on screen. How to achive it? My line of code as following.
public delegate void BindGrid_Delegate();
protected void btnSearch_Click(object sender, EventArgs e)
{
try
{
// databind of all the controls
BindGrid_Delegate bd = new BindGrid_Delegate(BindGrid);
IAsyncResult ar = bd.BeginInvoke(null, null); //invoking the method
}
catch (Exception ex)
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "PageException", "alert('" + ex.Message + "');", true);
}
}
private void BindGrid()
{
try
{
DataSet ResultDataSet = GetData();
gvShowResult.DataSource = ResultDataSet;
gvShowResult.DataBind();
UpdatePanel2.Update();
}
catch (Exception ex)
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "PageException", "alert('" + ex.Message + "');", true);
}
}
Updatemode for updatepanel is conditional.
Thanks in advance!
Any help will be appreciated.
AVADHESH PATEL
13-May-2013