BrightIdeasSoftware.VirtualObjectListView.GetDisplayOrderOfItemIndex C# (CSharp) Метод

GetDisplayOrderOfItemIndex() публичный Метод

Return the position of the given itemIndex in the list as it currently 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 GetDisplayOrderOfItemIndex ( int itemIndex ) : int
itemIndex int
Результат int
        public override int GetDisplayOrderOfItemIndex(int itemIndex)
        {
            if (!this.ShowGroups)
                return itemIndex;

            int groupIndex = this.GroupingStrategy.GetGroup(itemIndex);
            int displayIndex = 0;
            for (int i = 0; i < groupIndex - 1; i++)
                displayIndex += this.OLVGroups[i].VirtualItemCount;
            displayIndex += this.GroupingStrategy.GetIndexWithinGroup(this.OLVGroups[groupIndex], itemIndex);

            return displayIndex;
        }