BrightIdeasSoftware.ObjectListView.GetNextItem C# (CSharp) Method

GetNextItem() public method

Return the ListViewItem that appears immediately after the given item. If the given item is null, the first item in the list will be returned. Return null if the given item is the last item.
public GetNextItem ( OLVListItem itemToFind ) : OLVListItem
itemToFind OLVListItem The item that is before the item that is returned, or null
return OLVListItem
        public virtual OLVListItem GetNextItem(OLVListItem itemToFind)
        {
            if (this.ShowGroups) {
                bool isFound = (itemToFind == null);
                foreach (ListViewGroup group in this.Groups) {
                    foreach (OLVListItem olvi in group.Items) {
                        if (isFound)
                            return olvi;
                        isFound = (itemToFind == olvi);
                    }
                }
                return null;
            }
            if (this.GetItemCount() == 0)
                return null;
            if (itemToFind == null)
                return this.GetItem(0);
            if (itemToFind.Index == this.GetItemCount() - 1)
                return null;
            return this.GetItem(itemToFind.Index + 1);
        }
ObjectListView