Ejemplo n.º 1
0
        internal void SetDisplayIndex(TreeListViewColumnHeader column, int newDisplayIndex)
        {
            if (!Contains(column))
            {
                return;
            }

            if (newDisplayIndex >= Count)
            {
                newDisplayIndex = Count - 1;
            }

            int curDisplayIndex = column.DisplayIndex;

            if (curDisplayIndex == newDisplayIndex)
            {
                return;
            }

            _logicalData.RemoveAt(curDisplayIndex);
            _logicalData.Insert(newDisplayIndex, column);

            if (_listView != null)
            {
                _listView.ColumnInvalidated(null, false, true);
            }
        }