English 中文(简体)
• 如何重新填满rad网,卸下页
原标题:How to Refresh the rad grid with out reload the page
  • 时间:2011-08-09 06:24:53
  •  标签:
  • telerik

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>
            <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

停车场

问题回答

• 发射“OnItemsRequested”服务器活动:

function clientClick() {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        ajaxManager.ajaxRequest("client");
    }




相关问题
Discuss on Commercial Component libraries of silverlight

I am now looking forward to buy a component library of silverlight for increase the productivity. I find there are number of them. Telerik ComponentOne ComponentArt Infragistics Syncfusion I found ...

Telerik RadGrid: grid clientside pagination

I have a web service which returns me some data,I am massaging this data and using this as datasource for my radgrid (telerik). The datasource is quite large, and would like to paginate it. I found ...

Binding a radgrid to a tree like data structure

I have a structure that looks following Class TreeNode { public TreeNode Parent { get; } public IEnumerable<TreeNode> Children { get; } public . . . . } I want to bind this to a ...

IQueryable into a hierarchy

I currently have an IQueryable of Questions. In my Question object I have and "id" and a "parentId" which can be used to create a hierarchy. Currently, I bind a RadTreeView to the IQueryable of ...

Expand all items in RadGrid Hierarchy

I am using a RadGrid (2009 Q2) with a hierarchy. Is there a way in the client api to expand all rows and vice-versa? thanks! Update: I have written a javascript function based off the api ...

热门标签