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

How to refresh rad grid with out reload page

2 Answers 426 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkateswara
Top achievements
Rank 1
Venkateswara asked on 09 Aug 2011, 09:49 AM
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" />
                    </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 i wrote like this 

 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();
           
        }
        else if (e.Argument == "RebindAndNavigate")
        {
                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();
       
     
        }
    }

Please help me how to reslove this issue

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 Aug 2011, 10:06 AM
Hi Venkateswararao,

Please add the main grid from which the two other Grids are populated as initiator for ajax request in the RadAjaxManager settings and both RadGrids which are populating depending on the first one selection to be updated controls. Also please note that the window which popups also should be added as updated control. If this doesn;t work for you, please try to wrap the three RadGrid controls and the radWindow control into single RadAjaxPanel and verify of this works for you.

Best wishes,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Maria Ilieva
Telerik team
answered on 12 Aug 2011, 10:06 AM
Hi Venkateswararao,

Please add the main grid from which the two other Grids are populated as initiator for ajax request in the RadAjaxManager settings and both RadGrids which are populating depending on the first one selection to be updated controls. Also please note that the window which popups also should be added as updated control. If this doesn;t work for you, please try to wrap the three RadGrid controls and the radWindow control into single RadAjaxPanel and verify of this works for you.

Best wishes,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Venkateswara
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or