We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sfTree does not refresh when items are added

Thread ID:

Created:

Updated:

Platform:

Replies:

142654 Feb 13,2019 12:43 PM UTC Apr 9,2019 07:24 AM UTC Xamarin.Forms 10
loading
Tags: SfTreeView
Christian Bender
Asked On February 13, 2019 12:43 PM UTC

Hello,

i am working on an app, which uses the sfTreeview. I want to add items while running my app. But the Tree does not refresh, though I am adding items. I can see in the debugger that the items are successfully added, but the tree does not show them. I am running on the android plattform.

I started developing with your example from the docs. I modified it and added an button to add new items to your example. It also does not refresh.

What can I do? Is it a bug or a mistake of mine?

Find attached the bounded sftree-example from Syncfusion.

Greetings from germany
Christian Bender

Attachment: TreeViewSample_f43fcf7a.zip

Jayaleshwari N [Syncfusion]
Replied On February 14, 2019 12:23 PM UTC

Hi Christian,  
   
Thanks for using Syncfusion Products.  
  
We have checked the reported query from our end. We would like to let you know that TreeView does not support to add items at run time so far. We have already considered this as feature request for real-time updates to TreeView. This feature is estimated to be available in our 2019 Volume 1 release which is expected to be rolled out at the end of March 2019. We will appreciate your patience until then.  
   
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link       
  
Regards,  
Jayaleshwari N 


Christian Bender
Replied On March 19, 2019 03:18 PM UTC

Hello,

as read in the news, there is real-time update support in the new beta of the sftreeview. But it seems that my example still does not update. Is there something to activate for the real-time support or am I missing something?

Thank you so far,
Christian Bender 

Deivaselvan Y [Syncfusion]
Replied On March 20, 2019 09:55 AM UTC

Hi Christian,  
 
To update the collection changes in UI, it is necessary to define the NoificationSubscriptionMode as CollectionChange. Here, NotificationSubscriptionMode enum has three members which update collection based on following members. They are 
 
* CollectionChange - Updates its tree structure when child items collection gets changed. 
* PropertyChange - Updates its ChildItems when associated collection property gets changed. 
* None - It is a default mode and it doesn't reflect collection/property changes  
 
We have modified the sample which works fine after defining this API, please find the sample from below. We will soon update regarding NotificatioSubscriptionMode in live and let you know once updated. 
 
 
Please let us know whether you need any further assistance. 
 
Regards, 
Deivaselvan 


Christian Bender
Replied On March 21, 2019 08:57 AM UTC

Thank you. This example works like I wanted.

So now I would like to use that in another App I am currently working on. I added the nuGet-packet with version 17.1.0.32-beta of the sfTreeView and added the NotificationSubsriptionMode to CollectionChange like in your sample.When I run my App, I get exception "Field not found: Xamarin.Forms.BindableProperty Syncfusion.XForms.TreeView.SfTreeView.NotificationSu…". 

Am I right that the refreshing is not included in the current online beta of the lib? Or do I miss something?

Edit: sorry, that was a mistake of mine. I did not see that the packet version in the android project was still old. Now it works as expected. Thank you very much


Christian Bender
Replied On March 21, 2019 04:32 PM UTC

Hello again,

after some testing, I would like to make an suggestion. Would it be possible, to add an NotificationSubscriptionMode with listening for CollectionChange AND PropertyChange?

Greetings,
Christian Bender

Deivaselvan Y [Syncfusion]
Replied On March 22, 2019 09:03 AM UTC

Hi Christian, 
 
We are glad that given solution works in your sample. We suspect your requirement is to get notification whenever collection and property gets changed in ViewModel & Model respectively. If yes, you can get notification in respective collectionchanged and property changed event like below. In attached sample, we have changed Collection in button click and changed property in item click, please find the sample for your reference. 
 
 
public class FileManagerViewModel 
{ 
      public ObservableCollection<FileManager> ImageNodeInfo 
      { 
        get { return imageNodeInfo; } 
        set { this.imageNodeInfo = value; } 
      } 
 
     private void GenerateSource() 
      { 
         ImageNodeInfo.CollectionChanged += ImageNodeInfo_CollectionChanged; 
      } 
            private void ImageNodeInfo_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 
      { 
        App.Current.MainPage.DisplayAlert("Alert","Collection changed","OK"); 
      } 
} 
 
If above is not your requirement then please explain your use case in detail. What do you mean `to add NotificationSubcriptionMode for CollectionChange and PropertyChange`? thereby we can provide you better solution at the earliest. 
 
Regards, 
Deivaselvan 


Christian Bender
Replied On April 1, 2019 07:05 AM UTC

Hello Deivaselvan,

thank you again! Thats exactly what I looked for. I was not aware that it is possible to set both Subscriptionmodes. But it seems that sometimes after a change the UI is not refreshed. Sometimes it happens, that you can not expand a nested group, because the expander is missing. If you fold the upper group and unfold it again, the expander is visible and you see the items of the nested group.

Regards,
Christian 

Dinesh Babu Yadav [Syncfusion]
Replied On April 2, 2019 12:47 PM UTC

Hi Christian, 
 
We have checked the reported query "Cannot expand a nested group, since expander is missing". Unfortunately, we are unable to  reproduce this issue at our end. Could you please revert us with below details, 
- Please share in which platform the issue is replicating. 
- Please share the device configuration details. 
 
Which would be useful for us to analyze the requirement better and provide an appropriate solution for this.  
 
Regards 
Dinesh Babu Yadav 


Christian Bender
Replied On April 8, 2019 05:48 PM UTC

Hello,

I will prepare a sample for next week on monday. 

Regards,
Christian

Dinesh Babu Yadav [Syncfusion]
Replied On April 9, 2019 07:24 AM UTC

Hi Christian, 
 
Thanks for the update. We will wait to hear from you. 
 
Regards, 
Dinesh Babu Yadav 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;