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

[Solved] Enabling ajax in dynamically created telerik grid

2 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Senthil
Top achievements
Rank 1
Senthil asked on 16 Oct 2008, 12:38 PM
Hi,

I am creating telerik rad grid dynamically based on the columns present in the database.  Problem is, I need to attach an updatepanel.

The aspx page has the following code

 

<form id="aspnetForm" method="post" runat="server" style="overflow: hidden">

 

 

 

 

<asp:ScriptManager id="MainScriptManager" EnablePartialRendering="true" runat="server"></asp:ScriptManager>

 

 

 

 

<telerik:RadAjaxManager ID="TelerikAjaxManager" runat="server" EnableAJAX="true">

 

 

 

 

</telerik:RadAjaxManager>

 

 

 

 

<telerik:RadAjaxLoadingPanel ID="TelerikAjaxLoadingPanel" runat="server" Height="75px" Width="75px" Transparency="50">

 

 

 

 

<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />

 

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 


In the code behind I am creating the grid by the following code.  Now I need to
specify the updatepanel for the grid (please see the red line below).  If ....

GridControlTelerik

Grid = UICommon.CreateMainetGridTelerik(this, SInfo.Name, RecordId, CanUpdate && !isReadOnly, controlStyles);

 

 

 

 

TelerikAjaxManager.AjaxSettings.AddAjaxSetting(Grid, Grid, TelerikAjaxLoadingPanel);

 

 

 

 

if (mainetGrid == null) break;

.......

I do this I get the following error:

 

Exception information:
Exception type: Telerik.Web.UI.
Exception message: Value cannot be null.
Parameter name: page

Thread information:
   at Telerik.Web.UI.RadAjaxManager.GetCurrent(Page page)
   at Telerik.Web.UI.AjaxSettingsCollection.AddAjaxSetting(Control ajaxifiedControl, Control updatedControl, RadAjaxLoadingPanel loadingPanel)
   at Main_Edit.ArrangeFieldsForEdit(ArrayList screenInfoList, ArrayList FRequiredList) in D:\...\Main_Edit.aspx.cs:line 10185
   at Main_Edit.InitLegacyControls(ArrayList screenInfoList) in D:\...\Main_Edit.aspx.cs:line 3631
   at Main_Edit.SetupControls() in D:\...\Main_Edit.aspx.cs:line 3256
   at Main_Edit.Page_Init(Object sender, EventArgs e) in D:\...\Main_Edit.aspx.cs:line 808
   at System.Web.UI.Control.OnInit(EventArgs e)
   at System.Web.UI.Page.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint).

Can you please help me to fix this error. 

Regards,
Senthil

 

 

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 20 Oct 2008, 08:09 AM
Hello Senthil,


Please find the attached project based on your code which works as expected at our side. Could you please modify it so the problem to appear and send us steps to reproduce the issue?

Best wishes,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James
Top achievements
Rank 1
answered on 19 Aug 2013, 12:54 PM
For our situation, the fix was to put the RadAjaxManager.AjaxSettings.AddAjaxSetting after adding the panel to the Controls (Controls.Add(panel)).
Tags
Grid
Asked by
Senthil
Top achievements
Rank 1
Answers by
Missing User
James
Top achievements
Rank 1
Share this question
or