reset Grid to prior state after Rebind()

3 posts, 1 answers
  1. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 17 Jan 2012 Link to this post

    I am rebinding a Hierarchical radgrid after closing a custom edit/insert form using the below code and javascript. I would like to reset the state of the Grid as it was when the user clicked to edit a record. Currently all childgrids close up to the master. The attached images show what I mean. EditDetailRecord.png is where I want the user to be after the Rebind(). AfterDataRebind.png is currently what they see.

    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.ClientEvents.OnRequestStart = "onRequestStart";
        manager.AjaxSettings.AddAjaxSetting(manager, this.__rejectedBatchesRadGrid);
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(Manager_AjaxRequest);  
     
        if (!IsPostBack) {  }
    }
     
    protected void Manager_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        this.__rejectedBatchesRadGrid.MasterTableView.SortExpressions.Clear();
        this.__rejectedBatchesRadGrid.MasterTableView.GroupByExpressions.Clear();
        this.__rejectedBatchesRadGrid.Rebind();
    }







  2. Answer
    Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 20 Jan 2012 Link to this post

    Hi Tim,

    Note that when calling RadGrid Rebind method the grid loses all its data associated with expanded items and items in edit mode. However, you could go through the Retain expanded/selected state in hierarchy on rebind forum thread for information how you could implement persisting state after rebind.

    Greetings,
    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 02 Feb 2012 Link to this post

    hey Antonio,
    I finally had a chance to get back to this and the sample project at the link you provided did solve the objective. Thanks again.
Back to Top