How to Refresh the rad grid with out reload the page
I have Master grid when i selected row based on selcted row i have display more than two rad grids based on selected row for these rad grid i have add ,edit delete when i click add link it is oen rad window addd adding record and page reload but i dont want to reload page i want refresh which grid is i added recoed for that i have use following code
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
<telerik:AjaxUpdatedControl ControlID="grdFiles" />
<telerik:AjaxUpdatedControl ControlID="grdResource" />
<telerik:AjaxUpdatedControl ControlID="grdMessages" />
<telerik:AjaxUpdatedControl ControlID="grdTasks" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="grdFiles">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdFiles" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="grdResource">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdResource" />
</UpdatedControls>
</telerik:AjaxSetting>
开发者_如何学JAVA <telerik:AjaxSetting AjaxControlID="grdMessages">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdMessages" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="grdTasks">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdTasks" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
in code behind
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) { if (e.Argument == "Rebind") {
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
RadGrid1.Rebind();
grdFiles.MasterTableView.SortExpressions.Clear();
grdFiles.MasterTableView.GroupByExpressions.Clear();
grdFiles.Rebind();
grdResource.MasterTableView.SortExpressions.Clear();
grdResource.MasterTableView.GroupByExpressions.Clear();
grdResource.Rebind();
grdMessages.MasterTableView.SortExpressions.Clear();
grdMessages.MasterTableView.GroupByExpressions.Clear();
grdMessages.Rebind();
grdTasks.MasterTableView.SortExpressions.Clear();
grdTasks.MasterTableView.GroupByExpressions.Clear();
grdTasks.Rebind();
}
else if (e.Argument == "RebindAndNavigate")
{
RadXmlHttpPanel1.RegisterWithScriptManager = false;
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
RadGrid1.Rebind();
grdFiles.MasterTableView.SortExpressions.Clear();
grdFiles.MasterTableView.GroupByExpressions.Clear();
grdFiles.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
grdFiles.Rebind();
grdResource.MasterTableView.SortExpressions.Clear();
grdResource.MasterTableView.GroupByExpressions.Clear();
grdResource.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
grdResource.Rebind();
grdMessages.MasterTableView.SortExpressions.Clear();
grdMessages.MasterTableView.GroupByExpressions.Clear();
grdMessages.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
grdMessages.Rebind();
grdTasks.MasterTableView.SortExpressions.Clear();
grdTasks.MasterTableView.GroupByExpressions.Clear();
grdTasks.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
grdTasks.Rebind();
}
}
please help me how to resolve this issue
Regar
call ajaxRequest() method in order to fire the OnItemsRequested server event:
function clientClick() {
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.ajaxRequest("client");
}
精彩评论