RadGrid And AddNewRecord(New Action By Me) Problem In Ajaxify Mode

4 posts, 0 answers
  1. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 22 Feb 2010 Link to this post

    hi my dear friends:
    i ajaxified my RadGrid like this :
                                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                                    <AjaxSettings> 
                                        <telerik:AjaxSetting AjaxControlID="grdPersonel"
                                            <UpdatedControls> 
                                                <telerik:AjaxUpdatedControl ControlID="grdPersonel"  
                                                    LoadingPanelID="RadAjaxLoadingPanel1" /> 
                                            </UpdatedControls> 
                                        </telerik:AjaxSetting> 
                                    </AjaxSettings> 
                                </telerik:RadAjaxManager> 
                                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 

    i am controling Radgrid AddNewRecord By Myself like this :
            protected void grdPersonel_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
            { 
                switch (e.CommandName) 
                { 
                    case RadGrid.InitInsertCommandName: 
                        { 
                            e.Canceled = true
                            hfEditMode.Value = "Insert"
                            ResetForm(); 
                            mvPersonel.SetActiveView(vwPersonelEdit); 
                            break; 
                        } 
                } 
            } 
     

    i have some views in my multyview (mvPersonel):
    View1 (vwForGird)-> my grid is here.
    View2 (vwPersonelEdit)-> I have A table here (with some textboxes and some lables and a save button)for add a new record in grid.
    when u press addnewrecord in grid so i reset all of the textboxes in View2 (vwPersonelEdit) and jump to it.
    that upper code was working prefectly until i ajaxified my radgrid like upper code.
    when i press addnewrecord i recieve this error :

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

    i really really wondering how can i solve this problem ?
    how can i force addnewrecord in radgrid to postback after click on it not callback...








  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 22 Feb 2010 Link to this post

    You need to change the AjaxUpdatedControl setting from grdPersonel to the MultiView control you are using. The reason for this is that RadAjaxManager cannot update controls that is not listed in the UpdateControls collection, thus the reason for the error.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 22 Feb 2010 Link to this post

    really thanks for your attention
    but can u show me that by code (by editing my code)????
    do u think this is the best idea about that problem?
    because by doing that ajaxifying is useless...
    1-i am using RadTabStrip in NestedViewTemplate  in my grid.
    2-grouping and sorting and filtering of my grid are Enable.
    because of 1 & 2 i ajaxified my grid.
    but with your solution it seems my grid is postbacking when u sort or group or expand (for viewing tabs in rad tabstrip).
    can u tell me how can i force AddNewRecord Of My Grid To have Regular PostBack Instead Of Calback?

  5. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 22 Feb 2010 Link to this post

    dear telerik team ....
    i really need your help
    i am so sad for losing ajaxify of my grid...
    is it possible by play RadAjaxManager1.EnableAJAX to false when press AddNewRecord?
    but i did bot work...
Back to Top