<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> |
6 Answers, 1 is accepted
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.
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!
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.
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.
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.