question

$$ANON_USER$$ avatar image
0 Votes"
$$ANON_USER$$ asked JarvanZhang-MSFT commented

Tree View in Xamarin Forms Android and iOS Devices

Hi how to implement Tree view in Android and iOS through Api Binding. ![86622-image.png][1] [1]: /answers/storage/attachments/86622-image.png

dotnet-xamarin
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, Bhuwancb99. You could customize a 'TreeView'. First, choose a collection data view such as CollectionView to display the title. Then use Xamarin.Community.Toolkit.Expander control to create a expander container.

Check the doc: https://docs.microsoft.com/en-us/xamarin/community-toolkit/views/expander

0 Votes 0 ·
image.png (27.1 KiB)

hi @JarvanZhang-MSFT

i am aslo trying as per suggested by you but how to display 3/4/5 based on records in tree view in expander.

0 Votes 0 ·

@JarvanZhang-MSFT ![86887-image.png][1] [1]: /answers/storage/attachments/86887-image.png

0 Votes 0 ·

If the view has many levels, Expander is not a good idea. Please use a 'TreeView' api instead, you could check the 'TemplateUI' suggested by alessandrocaliaro .

0 Votes 0 ·

1 Answer

alessandrocaliaro avatar image
0 Votes"
alessandrocaliaro answered alessandrocaliaro edited

You can take a look to

TemplateUI


· 11
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@alessandrocaliaro

i am implemented same code as suggested but always getting error on code .

i am attached my sample code and also suggest can i bind data through API .

can I use content page instead of tabbed page

below is my code


https://github.com/bhuwancb99/XamarinApp

0 Votes 0 ·

for me it works.
You have to download the TemplateUI project.
Compile it.
Add the TemplateUI.dll to your project and add it as a reference.
Remove from your project the "template" code you have addedd (control directory) and use the TemplateUI Control in your xmal

 xmlns:controls="clr-namespace:TemplateUI.Controls;assembly=TemplateUI"






0 Votes 0 ·

Hi @alessandrocaliaro

i am trying but not working working can you please explain how to add templateUI.dll as a reference or add same dll in all 3 branches like Android and iOS devices.

0 Votes 0 ·
Show more comments