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

Building a Treeview with data from a Web Service

4 Answers 110 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 28 Jan 2019, 10:06 PM

Hi, I'm having issues with the Treeview control and a WebService we use to obtain the tree's data. Im trying to replicate the tree shown on the attached file. I'm able to obtain the data from our WebService on JSON format. However, when I try to build the tree, it shows empty. If I manually add items to the tree, based on your documentation, it works. I will greatly appreciate is someone can give me a hand on this issue. Thanks in advance.

 

 

 

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 29 Jan 2019, 02:29 PM
Hi Dennis,

Is it possible for you to send us a sample app with the exact implementation you currently have? I am asking as it will be more efficient to look into the concrete case rather than guessing what might went wrong. Please open a support ticket and attach it there.

Thank you in advance for your cooperation.

Regards,
Yana
Progress 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
0
Dennis
Top achievements
Rank 1
answered on 29 Jan 2019, 05:10 PM

Hi, thanks for your response. I managed to get it to work. However, I'm having an issue with the text cell color property. Is not applying the specified color, it shows black text all the time. I tried different colors but the result is the same. By the way, how can I change the Expand arrow color? 

 

Thanks in advance for your help.

0
Yana
Telerik team
answered on 30 Jan 2019, 02:20 PM
Hello Dennis,

Glad to hear you've manage to resolve the issue with loading data.

As to the TextCellTextColor property - indeed this is an issue in RadTreeView, so I logged it on your behalf in our public portal, you could track its status at the link below:
https://feedback.telerik.com/xamarin/1385505-treeview-textcelltextcolor-property-of-the-itemstyle-is-not-applied

As a workaround, you could create an ItemTemplate ( judging from the screenshot you already have ItemTemplate defined) and set TextColor property directly to the telerikTreeView:ItemText element.
TextColor could be set to the ExpandCollapseIndicator as well in order to change the arrow color.

I have updated your Telerik points as a small sign of gratitude for reporting this issue.

Let me know if I can assist with anything else.

Regards,
Yana
Progress 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
0
Pavel R. Pavlov
Telerik team
answered on 20 May 2019, 01:00 PM
Hi Dennis,

I would like to update you on this matter. After taking a closer look at the reported issue we decided to delete the TextCellTextColor property from the TreeViewItemStyle. The reason behind this is the fact that this particular property is designed to work with the RadListView component when a ListViewTextCell is used. This property is not respected when a ListViewTemplateCell is used. The RadTreeView extends the RadListView class and uses specialized cell which is not the ListViewTextCell.

This is why we are going to remove the TextCellTextColor property from the TreeViewItemStyle class. It will be available only in the ListViewItemStyle. In order to achieve your scenario, you can use implicit styles, targeting the respective components which are used to visualize the expand/collapse indicator and the text of the TreeView items. More specifically you could use the following code:

...
        <telerikDataControls:RadTreeView.Resources>
            <ResourceDictionary>
                <Style TargetType="telerikTreeView:ItemText">
                    <Setter Property="TextColor" Value="White"/>
                </Style>
                <Style TargetType="telerikTreeView:ExpandCollapseIndicator">
                    <Setter Property="TextColor" Value="#0A3A82"/>
                </Style>
            </ResourceDictionary>
        </telerikDataControls:RadTreeView.Resources>
...

Where the the telerikTreeView namespace is defined like this:

xmlns:telerikTreeView="clr-namespace:Telerik.XamarinForms.DataControls.TreeView;assembly=Telerik.XamarinForms.DataControls"

Please evaluate this API and let us know how it goes on your side.

Regards,
Pavel R. Pavlov
Progress 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
Tags
TreeView
Asked by
Dennis
Top achievements
Rank 1
Answers by
Yana
Telerik team
Dennis
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or