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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Item Tapped

Thread ID:

Created:

Updated:

Platform:

Replies:

150217 Dec 26,2019 03:18 PM UTC Dec 30,2019 05:44 AM UTC Xamarin.Forms 2
loading
Tags: SfTreeView
Emad Afaq
Asked On December 26, 2019 03:41 PM UTC

My TreeView (Load On Demand) shows a collection I am trying to get the Id of the selected item but the issue is I am showing Title in the treeview and I want to have its ID that will be passed to "PBIDetailsPage"

Example:
Item Name
     Item Child Name
     Item Child Name
Item Name

I am showing the Item Name but upon selection I want to pass its ID to the new page. Can you please advise as I am stuck here.
BTW, it shows me null value error



Emad Afaq
Replied On December 27, 2019 07:27 AM UTC

I managed to see to it:

I want this ID, But I can access it. please advise



Lakshmi Natarajan [Syncfusion]
Replied On December 30, 2019 05:44 AM UTC

Hi Emad, 
  
Thank you for contacting Syncfusion support. 
  
We have checked the reported query from our end. We would like to let you know that you can access the model class property (i.e, ID) by below code, 
  
private void TreeView_ItemTapped(object sender, Syncfusion.XForms.TreeView.ItemTappedEventArgs e) 
{ 
    var id = ((e.Node as TreeViewNode).Content as StagingModel).id; 
    DisplayAlert("""Tapped item ID is " + id"Ok"); 
} 
  
Please let us know if still facing the same issue. If not, please provide a sample based on your requirement and revert us back. 
  
Regards, 
Lakshmi Natarajan 


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

Live Chat Icon For mobile
Live Chat Icon