/// <summary>
 /// Uncollapses all groups of the ListView by adding them back.
 /// </summary>
 public void UnCollapseAllGroups()
 {
     foreach (var taxon in HiddenTaxonList)
     {
         SelectedTaxonListSource.Add(taxon);
     }
     HiddenTaxonList.Clear();
     AddListsToGroups(SelectedTaxonListSource);
 }
        public void ToggleGroupingByOrderName(string orderName)
        {
            List <Taxon> tempTBDTaxa = new List <Taxon>();

            bool foundInSelected = false;

            foreach (var taxonGroup in SelectedTaxonList)
            {
                foreach (var taxon in taxonGroup)
                {
                    if (taxon.OrderName == orderName)
                    {
                        foundInSelected = true;
                    }
                    HiddenTaxonList.Add(taxon);
                }
            }

            SelectedTaxonListSource.Clear();

            if (!foundInSelected)
            {
                foreach (var taxon in HiddenTaxonList)
                {
                    if (taxon.OrderName == orderName)
                    {
                        SelectedTaxonListSource.Add(taxon);
                        tempTBDTaxa.Add(taxon);
                    }
                }
                foreach (Taxon t in tempTBDTaxa)
                {
                    HiddenTaxonList.Remove(t);
                }
            }

            AddListsToGroups(SelectedTaxonListSource);
        }