BrightIdeasSoftware.ObjectListView.GetNthItemInDisplayOrder C# (CSharp) Method

GetNthItemInDisplayOrder() public method

Return the n'th item (0-based) in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetNthItemInDisplayOrder ( int n ) : OLVListItem
n int
return OLVListItem
        public virtual OLVListItem GetNthItemInDisplayOrder(int n)
        {
            if (!this.ShowGroups)
                return this.GetItem(n);

            foreach (ListViewGroup group in this.Groups) {
                if (n < group.Items.Count)
                    return (OLVListItem)group.Items[n];

                n -= group.Items.Count;
            }

            return null;
        }
ObjectListView