Search code examples
c#selectedindexchangedradlistview

RadListView SelectedIndexChanged is firing each time a new item is added


I have a problem with RadListView for C# Winforms that if I add 300 items to the listview the SelectedIndexChanged is firing 300 times. What can I do to make it stay selected on the first item and not fire every time a new item is added? Because it selects every time the last item.

This is the add code:

 this.lstFileList.Items.Add(item);

Solution

  • Instead of adding them one at a time, you can bind directly to an IEnumerable using the DataSource property.