private void btnSelect_Click(object sender, EventArgs e) { var selectedItem = lsbSourceProjects.SelectedItems; if (selectedItem.Count > 0) { foreach (var item in selectedItem) { var project = item as JiraProject; SelectedJiraProjects.Add(project); var forIndex = ForSelectedJiraProjects.IndexOf(project); var searchIndex = SearchSource.IndexOf(project); if (forIndex != -1) { ForSelectedJiraProjects.RemoveAt(forIndex); } if (searchIndex != -1) { SearchSource.RemoveAt(searchIndex); } } RebindingDataSource(); } }