BrightIdeasSoftware.VirtualObjectListView.GetLastItemInDisplayOrder C# (CSharp) Method

GetLastItemInDisplayOrder() public method

Return the last item 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 GetLastItemInDisplayOrder ( ) : BrightIdeasSoftware.OLVListItem
return BrightIdeasSoftware.OLVListItem
        public override OLVListItem GetLastItemInDisplayOrder()
        {
            if (!this.ShowGroups)
                return base.GetLastItemInDisplayOrder();

            if (this.OLVGroups.Count > 0) {
                OLVGroup lastGroup = this.OLVGroups[this.OLVGroups.Count - 1];
                if (lastGroup.VirtualItemCount > 0)
                    return this.GetItem(this.GroupingStrategy.GetGroupMember(lastGroup, lastGroup.VirtualItemCount - 1));
            }

            return null;
        }