RadTreeList does not reflect updated data on UpdateCommand

2 posts, 0 answers
  1. Brent
    Brent avatar
    1 posts
    Member since:
    Aug 2015

    Posted 19 Aug 2015 Link to this post

    I am using a RadTreeList with an UpdateCommand, which updates one BIT field on SQL Server via a stored procedure. After the update, I force the RadTreeList to rebind its data source, but ​it OCCASIONALLY will not reflect the updated data (which I know for certain is getting set on SQL Server). Sometimes it shows the new value, sometimes not.

     What I have tried in the UpdateCommand:

    protected void rtlRoster_UpdateCommand(object sender, TreeListCommandEventArgs e)
    {

         //some code eliminated for brevity

         //Perform the update via SQL stored procedure
         SQL.Update​StoredProc(params...);

         //I have tried sleeping before reloading the data source, which is not preferred
         Thread.Sleep(1500);

         //I have tried forcing the data source to clear out explicitly and then resetting it to the proper data source afterwards
         rtlRoster.DataSource = new ArrayList();
         rtlRoster.DataBind();

         //I have tried ​forcing it to reload the data source explicitly
         rtlRoster_NeedDataSource(sender, new TreeListNeedDataSourceEventArgs(TreeListRebindReason.ExplicitRebind));

     

        //I have tried using this code from an online Telerik example (http://docs.telerik.com/devtools/aspnet-ajax/controls/treelist/data-editing/updating-records/using-inplace-and-editforms-modes)
         rtlRoster.EditIndexes.Clear();
         rtlRoster.Rebind();

     

        //And I have tried the brute force way of reloading the page           

        Response.Redirect(Request.RawUrl);

     }

     

    I was hoping there would be some obvious setting that I could control, such as RadGrid's <ClientSettings>​<DataBinding EnableCache="false">, but I see no such property on the RadTreeList.

     

    Any ideas why this would be happening intermittently and how to fix it?

     

    ASP.NET version: 4.0.30319.34209 (though the .NET Framework is 4.5) 
    OS: Windows 8.1 Pro 
    exact browser version: IE11, Chrome 44.0.2403.155 m, and FF 39.0 
    exact version of the Telerik product:  Telerik.Web.UI.dll 2013.2.717.45
    preferred programming language (VB.NET or C#): C#

     

    Thanks,

    Brent Wood

  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 24 Aug 2015 Link to this post

    Hi,

    Generally the control should rebind automatically thus visualizing the updated data. That said I suggest removing all the highlighted code and testing the page again.

    C#:
    protected void rtlRoster_UpdateCommand(object sender, TreeListCommandEventArgs e)
    {
     
         //some code eliminated for brevity
     
         //Perform the update via SQL stored procedure
         SQL.Update​StoredProc(params...);
     
         //I have tried sleeping before reloading the data source, which is not preferred
         Thread.Sleep(1500);
     
         //I have tried forcing the data source to clear out explicitly and then resetting it to the proper data source afterwards
         rtlRoster.DataSource = new ArrayList();
         rtlRoster.DataBind();
     
         //I have tried ​forcing it to reload the data source explicitly
         rtlRoster_NeedDataSource(sender, new TreeListNeedDataSourceEventArgs(TreeListRebindReason.ExplicitRebind));
     
      
     
         rtlRoster.EditIndexes.Clear();
         rtlRoster.Rebind();
     
      
     
        //And I have tried the brute force way of reloading the page          
     
        Response.Redirect(Request.RawUrl);
     
     }

    If the suggested approach does not prove helpful please share with us the entire page contents(markup and code-behind) so we could examine the implementation and further research the matter.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top