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. Image for the cookie policy date

Disable SfListView groups selection

Hi, how can I avoid the selection of groups as an item in a sf list view


Thanks


2 Replies

BA BagavathiPerumal Apranandham Syncfusion Team April 24, 2023 12:39 PM UTC

Hi Orlando Villarreal,


We have created a sample based on your requirement. Please refer to the attached sample and code snippets for your reference.

Code Snippets:

private void SfListView1_SelectionChanging(object sender, ItemSelectionChangingEventArgs e)
{
       if (selectedGroupKey != null)
       {
           foreach (var item in e.AddedItems)
           {
                  if (item.ToString().Contains(selectedGroupKey))
                  {
                         e.Cancel = true;
                         break;
                  }
            }
        }
}



Regards,
Bagavathi Perumal A


Attachment: SfListiew_WinForms_42ee87df.zip


OV Orlando Villarreal replied to BagavathiPerumal Apranandham April 25, 2023 05:09 PM UTC

Thank you for the response , I will give it a try


Regards.


Loader.
Up arrow icon