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

[Solved] Unable to rebind the datagrid using AjaxManager

2 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Susanto
Top achievements
Rank 1
Susanto asked on 14 Jun 2008, 01:32 AM
Hi,

I am using new RadControl ASP.NET for AJAX latest build.

I am testing the RadGrid and having problem.

Here is the scenario.
I do have MasterPage. The ScriptManager is inside masterpage.
I have a page that is using MasterPage.
The page contains a RadGrid and DataSource connect to SQL Server.

The RadGrid allows user to add, modify and delete. The Add / Modify button using RadWindow when its clicked.

when the user clicked "Modify" inside the grid (from one of the row), there will be a window pop up. Once the user update the button, the RadWindow will be closed and the AjaxManager.AjaxRequest('Rebind') is called. The AjaxRequest contains "RadGrid1.Rebind()" command.
Once the AjaxRequest is called, I got the following error:
-------------------------

Value cannot be null.
Parameter name: key

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.ArgumentNullException: Value cannot be null.
Parameter name: key

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +41
   System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +2667593
   System.Collections.Generic.Dictionary`2.ContainsKey(TKey key) +4
   Telerik.Web.UI.RadAjaxControl.CreateUpdatePanel(Control initiator, String eventName, Control updated) +582
   Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e) +1481
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +2117788
   System.Web.UI.Control.PreRenderRecursiveInternal() +86
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
----------------------------------

I have double checked the DataKeyValues in the Grid and its there. I dont know what is going on.

I tried so many things to work around it, but unable to do so. I tried using RadAjaxPanel, RadAjaxManager, PostBack when the window closed, etc, but all failed.

In summary,
- The page contains MasterPage that have ScriptManager
- The page contains RadGrid that will popup RadWindow.
- I have followed the sample from LiveDemo but failed as well.

Anyone can help me out ?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 16 Jun 2008, 02:59 PM
Hi Susanto,

I think that the project from the following KB article can become a good starting point for your implementation:

http://www.telerik.com/support/kb/article/b454K-gmb-b454T-cba-b454c-cba.aspx

Additionally, how to reference RadAjaxManager in master/content page scenario and invoke its ajaxRequest(eventArgs) method from the client you can see from the following resources:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Manager/MasterPage/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/ajxajaxmasterpage.html

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Susanto
Top achievements
Rank 1
answered on 25 Jun 2008, 11:07 PM
Thanks for the reply.

I used exactly as what the guide showed.

It does not work.

anyway, I have found a work around it by put the entire grid in RadAjax and call AjaxRequestWithTarget(grid, argument).

I still cant use RadAjaxManager, even I have follow the sample.

till now, I am still unable to make the RadAjaxManager works.

Cheerz.
Tags
Grid
Asked by
Susanto
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Susanto
Top achievements
Rank 1
Share this question
or