BrightIdeasSoftware.ObjectListView.GetDisplayOrderOfItemIndex C# (CSharp) 메소드

GetDisplayOrderOfItemIndex() 공개 메소드

Return the display index of the given listviewitem index. 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 virtual int GetDisplayOrderOfItemIndex(int itemIndex)
        {
            if (!this.ShowGroups)
                return itemIndex;

            // TODO: This could be optimized
            int i = 0;
            foreach (ListViewGroup lvg in this.Groups) {
                foreach (ListViewItem lvi in lvg.Items) {
                    if (lvi.Index == itemIndex)
                        return i;
                    i++;
                }
            }

            return -1;
        }
ObjectListView