Get the selected item value

Hi,
With your listview, i can get the selected item index but not the value?? This is a big problem
Also there is no "ItemSelected" property.
One more think: selected-tap-change: these properties sometimes overlap.

6 Replies

VR Vigneshkumar Ramasamy Syncfusion Team July 27, 2018 07:19 AM UTC

Hi PinarCan,  
  
Thanks for contacting Syncfusion support.  
  
Query 1:  
  
We have checked the reported query “Get the SelectedItem value” from our end. We would like to let you know that you can get the selected items from the SelectedItem and SelectedItems property. We have already mentioned this in our documentation. Please refer the below link.  
  
  
Query 2: Overlap issue  
  
We have not understand your query clearly. Could you please share more details about the reported query which would help us to analyze the query better and provide an appropriate solution.  
  
Regards,  
Vigneshkumar R 



PN Preethi Nesakkan Gnanadurai Syncfusion Team July 27, 2018 12:38 PM UTC

From: Pinar Can . 
Okay i don’t use the MVVM-Model. So where can i put or hide the selected item in Cross-Platform? 
Or let me ask: I want to show selected item, how can I?  With method? 
 
These not work:   private void SelectedItemClicked(object sender, SelectedItemChangedEventArgs e) 
        { 
            try 
            { 
                var selected =(Student)e.SelectedItem; 
                 
                DisplayAlert("Selected Item-Student Name:", selected.Name , "OK"); 
            } 
            catch (Exception ex) 
            { 
                DisplayAlert("Error: ", ex.Message, "OK"); 
            } 
        } 
 
Pınar CAN 



PN Preethi Nesakkan Gnanadurai Syncfusion Team July 30, 2018 04:39 AM UTC

From: Pinar Can  
Any change? 



VR Vigneshkumar Ramasamy Syncfusion Team July 30, 2018 10:10 AM UTC

Hi PinarCan, 
 
   
We have checked the reported query “How to get the selected item value” from our end. We would like to let you know that you can achieve your requirement by using the SelectionChanged event or ItemTapped event like below code snippet.   
   
Code Example [C#]:   
        private void SFlistView_SelectionChanged(object sender, ItemSelectionChangedEventArgs e)   
        {   
            var item = e.AddedItems[0] as Contacts;   
            DisplayAlert("Alert""Selected Item = " + item.ContactName, "OK");   
        }   
   
        //private void SFlistView_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e)   
        //{   
        //    var item = e.ItemData as Contacts;   
        //    DisplayAlert("Alert", "Selected Item = " + item.ContactName, "OK");   
        //}   
   
   
For your reference we have attached the sample and you can download it from the below link.   
   
   
Please let us know if you require further assistance.   
   
Regards,   
Vigneshkumar R  
 



PN Preethi Nesakkan Gnanadurai Syncfusion Team August 1, 2018 04:17 AM UTC

From: Pinar Can. 

Yes! These are what i needed. Thank for cooperation.  
 
Pınar CAN 



RS Rawoof Sharief Muthuja Sherif Syncfusion Team August 1, 2018 05:50 AM UTC

Hi Pinar can, 
  
Thanks for the update. 
  
Regards, 
Rawoof M. 


Loader.
Up arrow icon