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

Grid rebind and AjaxManager

6 Answers 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 06 Oct 2008, 10:32 AM
Hi,

I have an issue with configurung the RadAjaxManager. I've got a RadGrid which in included in a RadDock and contains a column with a custom delete-button. The page also uses a RadAjaxManagerProxy.
Now, the problem is, that I can't get the AjaxManager configure correctly to update the grid after a record has been deleted.
Here's my AjaxManager configuration:
<AjaxSettings> 
           <telerik:AjaxSetting AjaxControlID="DeleteButton"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="UserGrid" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="UserGrid"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="UserGrid" /> 
                </UpdatedControls> 
</telerik:AjaxSetting> 
</AjaxSettings> 
What's wrong with this?

Best regards,
Robert

6 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 07 Oct 2008, 09:47 PM
Hi,

I did some reasearch and added a button on the RadDock. Then I configured the AjaxManagerProxy to let the grid update the Button and itself. In the deletebutton-handler I change the button's text.
Now, when I delete a column in the grid, the button gets updated but the grid is not.
I'm stuck here.

Any help is appreciated.
Best regards,
Robert
0
Iana Tsolova
Telerik team
answered on 08 Oct 2008, 02:03 PM
Hi Robert,

From the given information I assume that your grid has GridTemplateColumn with delete button in its ItemTemplate. If yes, you only need to add setting where the grid is updating itself:

<AjaxSettings>    
   <telerik:AjaxSetting AjaxControlID="UserGrid">    
      <UpdatedControls>    
          <telerik:AjaxUpdatedControl ControlID="UserGrid" />    
      </UpdatedControls>    
   </telerik:AjaxSetting>    
</AjaxSettings>    
 

and the grid will be updated after delete button is clicked.

You can find more about deleting records with RadGrid in the following online resources:
http://www.telerik.com/help/aspnet-ajax/grdhowtodeletearecord.html
http://www.telerik.com/help/aspnet-ajax/grdaddingdeleteprompt.html
http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/DataEditing/EditModes/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/grdcommandreference.html

Let me know how it goes.

Sincerely yours,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JEN LA
Top achievements
Rank 1
answered on 09 Jan 2009, 09:33 PM

Hello, I need help using RadAjaxManager and RadGrid.

- Platform:  Asp.net 1.1 (visual studio .net 2003)
- RADcontrols for ASP.net q1 2008

scenario:
I have 2 radgrids on my webform.  Each radgrid is in a separate pageView using the radTabStrip to show/hide each respective grid.

On "RadGrid1", I have a template column that has some buttons that fire off the "RadGrid1_ItemCommand" event. Within my "RadGrid1_ItemCommand" i have code that manipulates some data.  After the code has executed, I would like to refresh/rebind RadGrid2.

I have tried numerious things such as setting "DataSourcePersistanceMode=NoPersistance", "EnableViewState=False" ,etc, but have had no luck in updating RadGrid2, when a button on RadGrid1 is clicked.

Here is some sample code of my "RadGrid1_ItemCommand" event:

private void rgAVIPPOCList_ItemCommand(object source, Telerik.WebControls.GridCommandEventArgs e)  
        {  
            if(e.Item is Telerik.WebControls.GridDataItem)  
                {  
                    GridDataItem dataBoundItem = e.Item as GridDataItem;  
                      
                    if(e.CommandName == "Delete")  
                    {                                                                 
                        rgAVIPPOCList.Rebind();  
 
                        //also refresh POC grid  
                        rgClinicPOCList.DataSource = null;  
                        rgClinicPOCList.Rebind();   
                    }                                 
                    } 

since that part of the code was not refreshing/rebinding my RadGrid2, I decided to use RadAjaxManager.

I implemented RadAjaxManager as follows:
    <radA:RadAjaxManager id="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <rada:AjaxSetting AjaxControlID="rgClinicPOCList">  
                        <UpdatedControls> 
                            <rada:AjaxUpdatedControl ControlID="rgAVIPPOCList"></rada:AjaxUpdatedControl> 
                        </UpdatedControls> 
                    </rada:AjaxSetting> 
                </AjaxSettings> 
            </radA:RadAjaxManager> 

After implementing the RadAjaxManager on my webform, I still can not get RadGrid2 to rebind after an button is clicked on RadGrid1.

Please help!  Thanks!
0
Iana Tsolova
Telerik team
answered on 10 Jan 2009, 12:12 PM
Hello JEN LA,

I suggest that you try setting the RenderSelectedPageOlny property of the RadMultiPage to true and see if it makes any difference. In this case you can remove the preceding ajax setting.

Check it out and let me know if this helps.

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JEN LA
Top achievements
Rank 1
answered on 12 Jan 2009, 04:08 PM
Iana,

I tried what you suggested by setting the "RenderSelectedPageOlny=true" of the RadMultiPage, but that did not help at all.   in fact, now that I have set this property on the radMultipage, when I click on the Tab2 to show my Grid2, it shows nothing.  I have 4 tabs, but now only the first tab is rendering its respective pageView.  All the other tabs are no longer rendering any  html.   I have "autopostback=false" on the TabStrip.

Could you provide more suggestions on how to get my 2 Radgrids to update each other?  I have set "enableAJAX=false" for both grids and it works when this value is false.  But I would like for it to work as an 'ajaxified' grid.

I have tried 2 different approaches to get an 'ajaxified' grid:

1. Set "enableAJAX=true" on the RADgrids itself

2. Use AjaxManager on the page

both with no luck....

Please advise.
0
JEN LA
Top achievements
Rank 1
answered on 12 Jan 2009, 08:39 PM
i figured out how to get my 2 radgrids on a single page to rebind via ajax.

1. i had to set "enableAJAX=false" on each RADgrid.
2. Then dropped in a "RAD Ajax Panel" control onto my web form
3. Wrapped the "RAD ajax panel" around the RADmulti page control that contains my RADgrids.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Iana Tsolova
Telerik team
JEN LA
Top achievements
Rank 1
Share this question
or