Problem With Context Action With List View Selection Item

Problem 1. When i Long press the listview i get the context menu where it blocks the acc no where user made a long press, but after user makes a long press context menu button appear but user is still able to navigate on the list and can select the other acc no, i want to stop that, until the user does close the context menu there should be no activity on the listview,


Problem 2. If the first item is selected on list and i long press on 3 item in the list the selection of first item still persist 


Am not able to solve this issue , i am using mvvm pattern please help over it 

Attachment: LongPressOnOther_de4f0789.zip

3 Replies

MK Muthu Kumaran Gnanavinayagam Syncfusion Team November 20, 2017 07:06 PM UTC

Hi Ronak, 
 
We have checked with the reported queries. You can achieve your requirement “Need to un-focus the SfListView until closing the Context menu by handling the ItemTapped and Scroll Changed events. You can maintain a bool property to check whether the menu view is visible or not and set the Focus to the context menu. Then you can close the context meu view while selecting the menu action or by selecting the close button. You can achieve your another requirement “Need to unselect first selected item while holding another item” by clearing the SelectedItems collection in the ItemHolding event while displaying the context menu as like the below code snippets. 
 
Code example[C#]: 
private void ExtendedSfListView_ItemHolding(object sender, ItemHoldingEventArgs e) 
{ 
  var listview = sender as SfListView; 
  listview.SelectedItems.Clear(); 
  item = e.ItemData as Contacts; 
  popupView.ShowPopup(popupView.XPoint, popupView.YPoint); 
  popupView.Focus(); 
} 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu Kumaran. 



RO ronak November 21, 2017 04:47 AM UTC

I dont want to make another selection when context menu is visible my list should be disabled for selection
that what i was looking for 

Thankyou


MK Muthu Kumaran Gnanavinayagam Syncfusion Team November 23, 2017 12:41 PM UTC

Hi Ronak, 
 
We have checked the reported query “Need to disable selection when PopUp is in the view” from our side. You can achieve your requirement by using Boolean property to check whether the PopUp is in the View and handle the selection in ItemTapped event of SfListView as like below code example. 
 
Code Example[C#]: 
private void ExtendedSfListView_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) 
{ 
  if (popupView.IsVisible == true) 
    e.Handled = true; 
} 
 
Based on your requirement, we have prepared a sample and you can download it from the below location. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu Kumaran.  


Loader.
Up arrow icon