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

Can't Update Rad Grid. Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

2 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gc_0620
Top achievements
Rank 1
gc_0620 asked on 13 Jan 2010, 10:13 PM
Hellow every one.

Environment: RadControls for ASP.NET AJAX Q2 2009 SP1 with Visual Studio 2008 SP1, IE7 and Windows XP SP2.

I am using Master Detail Pages for my Project. While trying to update any Radgrid rows in one of my Content Page, I got this Below error message. But Insert works, no problem. Attached is also the print screen of the error  message.  Note: I have the same other Identical Content Pages. I do not have any problem with Update/Insert tasks in those pages.


Any suggestions will be appreciated. Thanks

GC_0620

_______________

Error Message when I run the content page:


Line: 6
Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

________________________________________________________________________________________________________

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
Timestamp: Wed, 13 Jan 2010 21:45:38 UTC

Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 6
Char: 62099
Code: 0
URI: http://localhost:2447/PAuthorization/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad2d891f5-3533-469c-b9a2-ac7d16eb23ff%3a16e4e7cd%3aed16cbdc%3ae330518b%3af7645509%3a24ee1bba%3a1e771326%3ac8618e41%3a58366029%3ae4f8f289



RadScriptManager and RadAjaxManager declaration in Master Page:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" LoadingPanelID="RadAjaxLoadingPanel1"   
                        /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

RadAjaxManagerProxy declaration in content pages:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">     
    <AjaxSettings>    
        <telerik:AjaxSetting AjaxControlID="RadGrid1">     
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
    </AjaxSettings>    
</telerik:RadAjaxManagerProxy>   

My Insert/Update codes in content page:

protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master")  
        {  
 
            SqlDataSource3.InsertParameters["LastUpdator"].DefaultValue = Session["SessionUserFullName"].ToString().Trim();  
            SqlDataSource3.InsertParameters["Creator"].DefaultValue = Session["SessionUserFullName"].ToString().Trim();  
        }  
        GridDataItem parentItem = e.Item.OwnerTableView.ParentItem as GridDataItem;  
        if (parentItem != null)  
        {  
            SqlDataSource4.SelectParameters["PersonId"].DefaultValue = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["PersonTableID"].ToString();  
            SqlDataSource4.InsertParameters["PersonId"].DefaultValue = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["PersonTableID"].ToString();  
        }   
    }  

    protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)  
    {  
       
        if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master")  
        {  
 
            // For Last Updator  
            GridEditableItem Txtbxupdateitem = (GridEditableItem)e.Item;  
            TextBox TxtLastupdator = (TextBox)Txtbxupdateitem.FindControl("TextboxLastUpdator");  
            TxtLastupdator.Text = Session["SessionUserFullName"].ToString().Trim();  
            SqlDataSource3.UpdateParameters["LastUpdator"].DefaultValue = TxtLastupdator.Text.ToString().Trim();  
                 
 
        }  
        GridDataItem parentItem = e.Item.OwnerTableView.ParentItem as GridDataItem;  
      if (parentItem != null)  
   {  
         SqlDataSource4.SelectParameters["PersonId"].DefaultValue = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["PersonTableID"].ToString();  
      SqlDataSource4.UpdateParameters["PersonId"].DefaultValue = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["PersonTableID"].ToString();  
      }   
 
    }  
 
 

 

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 14 Jan 2010, 07:28 AM
Hi,

I'm afraid that the provided information is insufficient in order to trace the exact cause for the error you are getting. In order to get more detailed information about where the error occurred please disable the ajax. If you continue to experiencing difficulties tracing the cause of the error please provide your grid declaration too.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
aruN N K
Top achievements
Rank 1
answered on 10 May 2010, 08:12 PM
Hi,

Is there any solution for the above mentioned issue, I am also facing the same when I launch my page, I tried disabling Ajax, then also I am getting the same error.

Regards,

Arun
Tags
Grid
Asked by
gc_0620
Top achievements
Rank 1
Answers by
Rosen
Telerik team
aruN N K
Top achievements
Rank 1
Share this question
or