Beispiel #1
0
        /// <summary>
        /// 收款-列表行单击触发事件
        ///  Created:20170330(ChengMengjia)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridSK_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e)
        {
            DevComponents.DotNetBar.SuperGrid.GridElement list = gridSK.GetSelectedRows()[0];
            string s = list.ToString();

            s = s.Replace("{", ",");
            s = s.Replace("}", ",");
            string[] listS = s.Split(',');
            txtSBatchNo.Tag     = listS[1].Trim();
            txtSBatchNo.Text    = listS[3].Trim();
            txtExplanation.Text = listS[4] == "<null>" ? "" : listS[4].Trim();
            intSRatio.Value     = listS[5] == "<null>" ? 0 : int.Parse(listS[5].Trim());
            txtAmount.Text      = listS[6] == "<null>" ? "0" : listS[6].Trim();
            txtSCondition.Text  = listS[7] == "<null>" ? "" : listS[7].Trim();
            dtSInDate.Value     = listS[9] == "<null>" ? DateTime.Now : DateTime.Parse(listS[9].Trim());
            DataHelper.SetComboBoxSelectItemByText(cbSFinishStatus, listS[8] == "<null>" ? "-1" : listS[8].Trim());
            txtSRemark.Text = listS[10] == "<null>" ? "" : listS[10].Trim();
        }
        /// <summary>
        /// Handles invocation of CompareElementsEvent events
        /// </summary>
        internal bool DoCompareElementsEvent(GridPanel panel,
            GridElement a, GridElement b, ref int result)
        {
            if (CompareElements != null)
            {
                GridCompareElementsEventArgs ev = new
                    GridCompareElementsEventArgs(panel, a, b);

                CompareElements(this, ev);

                result = ev.Result;

                return (ev.Cancel);
            }

            return (false);
        }
        /// <summary>
        /// Handles invocation of BeforeCheck events
        /// </summary>
        internal bool DoBeforeCheckEvent(GridPanel gridPanel, GridElement gridRow)
        {
            if (BeforeCheck != null)
            {
                GridBeforeCheckEventArgs ev = new
                    GridBeforeCheckEventArgs(gridPanel, gridRow);

                BeforeCheck(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
        /// <summary>
        /// Handles invocation of AfterCheckEvent events
        /// </summary>
        internal void DoAfterCheckEvent(GridPanel gridPanel, GridElement item)
        {
            if (AfterCheck != null)
            {
                GridAfterCheckEventArgs ev = new
                    GridAfterCheckEventArgs(gridPanel, item);

                AfterCheck(this, ev);
            }
        }
        /// <summary>
        /// Invalidates render of the grid element.
        /// </summary>
        /// <param name="gridElement">Element to invalidate rendering for.</param>
        internal void InvalidateRender(GridElement gridElement)
        {
            Rectangle bounds = gridElement.BoundsRelative;

            if (gridElement.Parent != null)
            {
                bounds.X -= _HScrollOffset;

                if (bounds.Y > _PrimaryGrid.FixedRowHeight)
                    bounds.Y -= _VScrollOffset;
            }

            Invalidate(bounds, true);
        }
        ///<summary>
        /// GridGetGroupIdEventArgs
        ///</summary>
        ///<param name="gridPanel">Associated GridPanel</param>
        ///<param name="gridItem">Associated grid element</param>
        ///<param name="column">Associated grid column</param>
        ///<param name="groupId">Associated Group identifier</param>
        public GridGetGroupIdEventArgs(
            GridPanel gridPanel, GridElement gridItem, GridColumn column, object groupId)
        {
            _GridPanel = gridPanel;
            _GridColumn = column;
            _GridItem = gridItem;

            _GroupId = groupId;
        }
 ///<summary>
 /// GridDragStartedEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="item"></param>
 ///<param name="e"></param>
 public GridItemDragEventArgs(GridPanel gridPanel, GridElement item, MouseEventArgs e)
     : base(e.Button, item)
 {
     _GridPanel = gridPanel;
 }
Beispiel #8
0
        /// <summary>
        /// Called by top-level control to pass message into the grid
        /// element. To handle it override corresponding On - virtual method.
        /// </summary>
        /// <param name="e"></param>
        internal override void InternalMouseMove(MouseEventArgs e)
        {
            GridElement element = GetElementAt(e);

            if (element != _MouseOverElement)
            {
                GridElement mouseOverElement = _MouseOverElement;

                if (mouseOverElement != null)
                    mouseOverElement.InternalMouseLeave(e);

                if (element != null)
                    element.InternalMouseEnter(e);

                _MouseOverElement = element;
            }

            if (element != null)
                element.InternalMouseMove(e);

            base.InternalMouseMove(e);
        }
 ///<summary>
 /// GridBeforeCheckEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="gridRow"></param>
 public GridBeforeCheckEventArgs(GridPanel gridPanel, GridElement gridRow)
     : base(gridPanel, gridRow)
 {
 }
Beispiel #10
0
 ///<summary>
 /// GridAfterCheckEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="item"></param>
 public GridAfterCheckEventArgs(GridPanel gridPanel, GridElement item)
     : base(gridPanel)
 {
     _Item = item;
 }
Beispiel #11
0
 /// <summary>
 /// Called after parent of the item has changed.
 /// </summary>
 /// <param name="oldParent">Reference to old parent.</param>
 /// <param name="newParent">Reference to new parent.</param>
 protected virtual void OnParentChanged(GridElement oldParent, GridElement newParent)
 {
     OnParentChanged(EventArgs.Empty);
 }
Beispiel #12
0
        private void SelectLastElement(GridElement selItem)
        {
            _Panel.SuperGrid.NeedToUpdateIndicees = true;
            _Panel.UpdateIndicees(_Panel, _Panel.Rows, true);

            if (selItem is GridCell)
                _Panel.SetSelected((GridCell)selItem, true);

            else if (selItem is GridRow)
                _Panel.SetSelected((GridRow)selItem, true);
        }
Beispiel #13
0
        private bool ItemIsSelectable(GridPanel panel, GridElement item)
        {
            if (item.Visible == false)
                return (false);
            
            if (item is GridGroup && panel.GroupHeaderKeyBehavior != GroupHeaderKeyBehavior.Select)
                return (false);

            return (item is GridContainer);
        }
Beispiel #14
0
        private bool IsElementAt(
            GridElement item, int x, int y, ref Rectangle bounds)
        {
            if (item.Visible == true)
            {
                bounds = item.BoundsRelative;

                if (item.Visible == true)
                {
                    if (item is GridPanel)
                        bounds = ((GridPanel)item).ContainerBounds;

                    bounds.X -= HScrollOffset;

                    if (item.IsVFrozen == false)
                        bounds.Y -= VScrollOffset;

                    if (bounds.Contains(x, y))
                        return (true);
                }
            }

            return (false);
        }
Beispiel #15
0
        /// <summary>
        /// Handles ItemDrag events
        /// </summary>
        internal bool DoItemDragEvent(GridElement element, MouseEventArgs e)
        {
            if (ItemDrag != null)
            {
                GridItemDragEventArgs ev = new
                    GridItemDragEventArgs(element.GridPanel, element, e);

                ItemDrag(this, ev);

                return (ev.Cancel);
            }

            return (true);
        }
Beispiel #16
0
 ///<summary>
 /// GridRowMovingEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="a"></param>
 ///<param name="b"></param>
 public GridCompareElementsEventArgs(
     GridPanel gridPanel, GridElement a, GridElement b)
     : base(gridPanel)
 {
     _ElementA = a;
     _ElementB = b;
 }
Beispiel #17
0
        /// <summary>
        /// Handles invocation of GetGroupId events
        /// </summary>
        internal void DoGetGroupIdEvent(
            GridElement row, GridColumn column, ref object groupId)
        {
            if (GetGroupId != null)
            {
                GridGetGroupIdEventArgs ev = new
                    GridGetGroupIdEventArgs(row.GridPanel, row, column, groupId);

                GetGroupId(this, ev);

                groupId = ev.GroupId ?? "<null>";
            }
        }
Beispiel #18
0
        /// <summary>
        /// Called by top-level control to pass message into the grid
        /// element. To handle it override corresponding On - virtual method.
        /// </summary>
        /// <param name="e"></param>
        internal override void InternalMouseLeave(EventArgs e)
        {
            GridElement mouseOverElement = _MouseOverElement;

            if (mouseOverElement != null)
            {
                mouseOverElement.InternalMouseLeave(e);
                _MouseOverElement = null;
            }

            base.InternalMouseLeave(e);
        }