I'm stumped over here.
I'm working on an page in application that uses Telerik RadGrids. I'd like to think it's pretty straight forward. Each row in the grid has an EditFormSettings Template set. There is a DropDownList and a Panel inside it. The DropDownList contains a number of different reports to display so when a user picks something, a UserControl is dynamically added to this panel and a report is shown, which is either another RadGrid or a RadRadialGauge inside a previously made UserControl. That functionality works as it should.
The problem comes when I go to expand another row if a RadGrid was loaded inside this panel. The following error is displayed:
*Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid JSON primitive: .*
This does not happen if the RadRadialGauge was first loaded and I go to expand another row. Only if it was the UserControl with the RadGrid. This UserControl is very elementary so I don't think there's anything in there over the top that could be the culprit.
Some code to help explain what I wrote.
<EditFormSettings EditFormType="Template">
<FormTemplate>
<div id="dashboardExpandedTemplate">
<asp:DropDownList ID="ddlReportsList" AutoPostBack="true" OnSelectedIndexChanged="ReportSelected" runat="server" />
<asp:Panel ID="pnlReports" runat="server" />
</div>
</FormTemplate>
</EditFormSettings>
protected void ReportSelected(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
if (ddl.SelectedIndex != 0)
{
GridEditFormItem editItem = (GridEditFormItem)ddl.NamingContainer;
Panel pnlReports = (Panel)editItem.FindControl("pnlReports");
pnlReports.Controls.Clear();
SavedReport saved = new SavedReport(int.Parse(ddl.SelectedValue));
Control cntrl = Page.LoadControl("/controls/" + saved.ControlPath);
}
}
Thank you in advanced.