This is a migrated thread and some comments may be shown as answers.

[Solved] RadGrid inside RadMultiPage disappearing on postback

1 Answer 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vincent
Top achievements
Rank 1
vincent asked on 08 Jul 2009, 04:31 PM
Hi all, I am having a problem with the RadGrid disappearing when loaded into a RadMultiPage. I dynamically load a control with a RadGrid into the RadMultiPage using the code below:  (Followed the Sample Code)

 

Invoices uc = (Invoices)Page.LoadControl(userControlName);

 

uc.OrgId = CurOrgId;

uc.ID = e.PageView.ID +

"_userControl";

 

e.PageView.Controls.Clear();

//Not sure if this does anything but I added it anyway.

 

e.PageView.Controls.Add(uc);

uc.DataBind();



The RadGrid is bound using the following:

protected

 

void dgInvoice_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

    string strSP = "GetInvoices";

 

    System.Data.SqlClient.

SqlParameter[] spParams = new System.Data.SqlClient.SqlParameter[1];

 

    spParams[0] =

new System.Data.SqlClient.SqlParameter("isActive", "1");

 

    this.dgInvoice.DataSource = Database.getDataSet(strSP, spParams);

 

}

 

 

 

    

The control with the RadGrid functions perfectly when housed alone in an aspx page.  But when we load the control dynamically into the RadMultiPage, the page displays fine...but clicking on anything that would fire a partial postback causes the entire RadGrid to disappear.

Any ideas?

Thanks in advance.

Vincent

 

 

1 Answer, 1 is accepted

Sort by
0
vincent
Top achievements
Rank 1
answered on 08 Jul 2009, 06:51 PM
Nevermind, I figured it out.  Shouldn't have bound the control.  Thanks.
Tags
Grid
Asked by
vincent
Top achievements
Rank 1
Answers by
vincent
Top achievements
Rank 1
Share this question
or