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. Image for the cookie policy date

ExpanderTemplate

Good day,

My requirement is to modify the expander in a sfListView similar to what is done below.

<treeview:SfTreeView.ExpanderTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.View>
                                <Grid>
                                    <Label Text="+" TextColor="White" FontAttributes="Bold"
                                           FontSize="Medium" HorizontalOptions="Center"
                                           VerticalOptions="Center" />
                                </Grid>
                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </treeview:SfTreeView.ExpanderTemplate>

The issue with this approach is that not all the branches of a tree displays the expander.
Kindly provide me with a link or sample code that can be used to implement this correctly.

Warm regards

Ian

5 Replies

DB Dinesh Babu Yadav Syncfusion Team May 16, 2019 07:43 AM UTC

Hi Ian, 
 
Thanks for using Syncfusion products. 
 
In our sample, we have replaced the given ExpanderTemplate with Transparent background color for TreeView control and noticed that the ExpanderTemplate remains empty i.e., `+` icon is not visible due to TextColor property as White in the code snippet. We suspect that due to background color of TreeView control, the issue may occur at the particular device since, Background color get vary from device to device, in the tested device, background color is white.  
 
If yes, we suggest you to set the Background color for TreeView control or TextColor for the Label in the ExpanderTemplate to resolve the issue at the application itself. Please find the sample in the below link. 
  
Sample Link : TreeViewExpanderIcon 
 
Meanwhile if the above provided solution does not related with the reported issue, we would like to inform you that the ExpanderTemplate/ExpanderIcon will be visible only for the Item which has ChildNodes in it. However, you can change the visibility of the expander icon in sample level using OnDemandLoading approach . We have mentioned regarding this in our UG Documentation. Please refer our documentation from below. 
 
 
Screenshot : 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 
 



IA Ian May 16, 2019 05:11 PM UTC

Hello Dinesh,

Thank you for the feedback.The sample provided works as required.

I compared the sample code with the code I am running and detected that besides that I am using MVVM, one other difference is that in my application I am using the  LoadOnDemandCommand binded to a ExecuteOnDemand handler:

TreeViewOnDemandCommand = new Command(ExecuteOnDemandLoading, CanExecuteOnDemandLoading);

 The expander "+" is shown initially  when childer are available but once the child view has expanded the "+" goes away and does not get displayed again, even when the child view is collapsed again.

Further - the default expander (no expander template used) works fine - although it is not what I require (">").

Could the issue be with the implementation of the ondemand loading and the use of the expander template?

Warm regards

Ian


DB Dinesh Babu Yadav Syncfusion Team May 17, 2019 06:53 AM UTC

Hi Ian, 
 
We have confirmed that reported issue is the defect and logged a defect report for the reported issue. The fix will be included in our upcoming weekly Nuget release which is scheduled to be rolled out at the 28th May, 2019. We will appreciate your patience until then.  
 
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    
 
Regards, 
Dinesh Babu Yadav 



GP Gnana Priya Namasivayam Syncfusion Team May 29, 2019 01:24 PM UTC

Hi Ian, 
 
Sorry for the delay caused. 
 
Due to some technical issue, we are unable to include the fix for the reported issue in the latest weekly nuget. However, we promise you that the fix will be included in our upcoming nuget release on June 4, 2019 without further delay. We will appreciate your patience until then.   
 
Regards, 
Gnana Priya N 
 
 



DB Dinesh Babu Yadav Syncfusion Team June 4, 2019 11:12 AM UTC

Hi Ian, 
 
Sorry for the delay caused. 
 
Due to some technical issue, we couldn’t able to include the fix in latest Nuget released on May 4, 2019. The fix will be included in Volume 2 release which is scheduled to be rolled out in the middle of June, 2019. We will appreciate your patience until then. Meanwhile, please let us know if you need patch before release. 
Regards, 
Dinesh Babu Yadav 


Loader.
Up arrow icon