Beispiel #1
0
        public int GetRowIndex(RadListDataItem item)
        {
            if (this.owner.ShowGroups)
            {
                int position = 0;
                foreach (ListGroup group in this.owner.Groups)
                {
                    if (group.Collapsed)
                    {
                        continue;
                    }

                    foreach (RadListDataItem listItem in group.Items)
                    {
                        if (item.Equals(listItem))
                        {
                            return(position);
                        }

                        position++;
                    }
                }
            }
            else
            {
                return(this.listSource.CollectionView.IndexOf(item));
            }

            return(-1);
        }
Beispiel #2
0
        public int GetRowIndex(RadListDataItem item)
        {
            if (!this.owner.ShowGroups)
            {
                return(this.listSource.CollectionView.IndexOf(item));
            }
            int num = 0;

            foreach (ListGroup group in (ReadOnlyCollection <Group <RadListDataItem> >) this.owner.Groups)
            {
                if (!group.Collapsed)
                {
                    foreach (RadListDataItem radListDataItem in (IEnumerable <RadListDataItem>)group.GetItems())
                    {
                        if (item.Equals((object)radListDataItem))
                        {
                            return(num);
                        }
                        ++num;
                    }
                }
            }
            return(-1);
        }