Beispiel #1
0
        /// <summary>
        /// Sets the <see cref="TargetItem"/> to the row that the mouse is over.
        /// </summary>
        /// <param name="treeListControl">
        /// The <see cref="TreeListControl"/> that the mouse is moving over
        /// </param>
        private void SetTargetItem(TreeListControl treeListControl, DragEventArgs e)
        {
            try
            {
                var treeListViewHitInfo = treeListControl.View.CalcHitInfo(this.DropPosition);
                var rowHandle           = treeListViewHitInfo.RowHandle;
                if (treeListViewHitInfo.InNodeExpandButton)
                {
                    treeListControl.View.ExpandNode(rowHandle);
                }

                if (treeListViewHitInfo.InRow)
                {
                    var dropPosition = treeListControl.View.GetCellElementByRowHandleAndColumn(rowHandle, treeListViewHitInfo.Column);
                    var row          = treeListControl.GetRow(rowHandle);

                    if (dropPosition != null)
                    {
                        this.targetHeight           = dropPosition.ActualHeight;
                        this.RelativePositionToDrop = e.GetPosition(dropPosition);
                    }

                    this.TargetItem = row;
                }
            }
            catch (NullReferenceException ex)
            {
                Logger.Debug(ex);
                this.TargetItem = null;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Sets the <see cref="TargetItem"/> to the row that the mouse is over.
        /// </summary>
        /// <param name="treeListControl">
        /// The <see cref="TreeListControl"/> that the mouse is moving over
        /// </param>
        private void SetTargetItem(TreeListControl treeListControl)
        {
            try
            {
                var treeListViewHitInfo = treeListControl.View.CalcHitInfo(this.DropPosition);
                var rowHandle           = treeListViewHitInfo.RowHandle;
                if (treeListViewHitInfo.InNodeExpandButton)
                {
                    treeListControl.View.ExpandNode(rowHandle);
                }

                if (treeListViewHitInfo.InRow)
                {
                    var row = treeListControl.GetRow(rowHandle);
                    this.TargetItem = row;
                }
            }
            catch (NullReferenceException ex)
            {
                Logger.Debug(ex);
                this.TargetItem = null;
            }
        }