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

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

3 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Majid Darab
Top achievements
Rank 1
Majid Darab asked on 22 Feb 2010, 03:35 PM
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...








3 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 22 Feb 2010, 03:47 PM
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.
0
Majid Darab
Top achievements
Rank 1
answered on 22 Feb 2010, 05:10 PM
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?

0
Majid Darab
Top achievements
Rank 1
answered on 22 Feb 2010, 06:46 PM
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...
Tags
Grid
Asked by
Majid Darab
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
Majid Darab
Top achievements
Rank 1
Share this question
or