Пример #1
0
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            GridView gridView = base.InitializeGridView();

            gridView.OptionsMenu.ShowGroupSummaryEditorItem = true;
            GridColumn column = gridView.Columns["FK_ICStockID"];

            if (column != null)
            {
                column.Group();
            }
            column = gridView.Columns["ICTransactionExchangeQty"];
            if (column != null)
            {
                column.SummaryItem.DisplayFormat = "{0:0.####}";
            }
            column = gridView.Columns["ICTransactionSaleOrderQty"];
            if (column != null)
            {
                column.SummaryItem.DisplayFormat = "{0:0.####}";
            }
            column = gridView.Columns["ICTransactionAvailableQty"];
            if (column != null)
            {
                column.SummaryItem.DisplayFormat = "{0:0.####}";
            }
            gridView.EndGrouping += GridView_EndGrouping;
            return(gridView);
        }
 private void myGridView2_DragObjectDrop(object sender, DevExpress.XtraGrid.Views.Base.DragObjectDropEventArgs e)
 {
     if (e.DropInfo.Valid && !e.Canceled && e.DragObject is GridColumn && ((GridColumn)e.DragObject).View != sender)
     {
         (sender as GridView).BeginUpdate();
         try
         {
             GridColumn sourceCol = e.DragObject as GridColumn;
             GridColumn column    = (sender as GridView).Columns.ColumnByFieldName(sourceCol.FieldName);
             if (column == null)
             {
                 column = (sender as GridView).Columns.AddField(sourceCol.FieldName);
             }
             if (((ColumnPositionInfo)e.DropInfo).InGroupPanel)
             {
                 column.Group();
                 column.GroupIndex = e.DropInfo.Index;
             }
             else
             {
                 column.VisibleIndex = e.DropInfo.Index;
             }
         }
         finally
         {
             (sender as GridView).EndDataUpdate();
         }
     }
 }
Пример #3
0
        protected override void AddColumnsToGridView(string strTableName, GridView gridView)
        {
            base.AddColumnsToGridView(strTableName, gridView);
            GridColumn column = new GridColumn();

            column.Caption   = "Tên nhân viên";
            column.FieldName = "EmployeeName";
            column.OptionsColumn.AllowEdit = false;
            column.Group();
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Thứ";
            column.FieldName = "ThName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);
        }
Пример #4
0
 void Group(DevExpress.XtraGrid.Views.Grid.GridView gridView)
 {
     if (gridView.OptionsView.ShowGroupPanel)
     {
         if (currentColumn != null && currentColumn.GroupIndex == -1)
         {
             currentColumn.Group();
         }
         else
         {
             if (currentColumn != null)
             {
                 currentColumn.UnGroup();
             }
         }
     }
 }
Пример #5
0
        public override void InitializeControl()
        {
            base.InitializeControl();
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            gridView.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;

            gridView.OptionsView.ShowFooter = true;
            GridColumn column = gridView.Columns["HRTimeKeeperDate"];

            if (column != null)
            {
                column.Group();
            }
            column = null;
            column = gridView.Columns["FK_HRMachineTimeKeeperID"];
            if (column != null)
            {
                //column.Group();
            }



            // repositoryItemDateEdit
            repositoryItemDateEdit            = new DevExpress.XtraEditors.Repository.RepositoryItemDateEdit();
            repositoryItemDateEdit.AutoHeight = false;
            repositoryItemDateEdit.DisplayFormat.FormatString = "HH:mm:ss";
            repositoryItemDateEdit.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
            repositoryItemDateEdit.Mask.EditMask = "HH:mm:ss";
            repositoryItemDateEdit.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            repositoryItemDateEdit.Name          = "repositoryItemDateEdit1";

            column = gridView.Columns["HRTimeKeeperTimeIn"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
                column.ColumnEdit = repositoryItemDateEdit;
            }

            column = gridView.Columns["HRTimeKeeperTimeOut"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
                column.ColumnEdit = repositoryItemDateEdit;
            }
        }
Пример #6
0
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            GridColumn column = new GridColumn();

            column.Caption   = "Mã đơn bán hàng";
            column.FieldName = "ARSaleOrderNo";
            gridView.Columns.Add(column);
            column = gridView.Columns["ARSaleOrderNo"];
            if (column != null)
            {
                column.Group();
            }
            foreach (GridColumn columnedit in gridView.Columns)
            {
                columnedit.OptionsColumn.AllowEdit = false;
            }
            return(gridView);
        }
Пример #7
0
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            gridView.OptionsFind.AlwaysVisible   = true;
            gridView.OptionsFind.ShowCloseButton = false;
            GridColumn column = gridView.Columns["ARSaleOrderItemProductUnitPrice"];

            if (column != null)
            {
                FormatNumbericColumn(column, false, "n3");
            }
            column = gridView.Columns["ARSaleOrderItemDiscountPercent"];
            if (column != null)
            {
                FormatNumbericColumn(column, false, "n2");
            }
            column = gridView.Columns["ARSaleOrderItemDiscountAmount"];
            if (column != null)
            {
                FormatNumbericColumn(column, false, "n3");
            }
            column = gridView.Columns["ARSaleOrderItemTaxPercent"];
            if (column != null)
            {
                FormatNumbericColumn(column, false, "n2");
            }
            column = gridView.Columns["ARSaleOrderItemTaxAmount"];
            if (column != null)
            {
                FormatNumbericColumn(column, true, "n3");
            }
            column = gridView.Columns["ARSaleOrderItemTotalAmount"];
            if (column != null)
            {
                FormatNumbericColumn(column, false, "n3");
            }
            column = gridView.Columns["ARSaleOrderItemProductQty"];
            if (column != null)
            {
                FormatNumbericColumn(column, false, "n3");
            }
            column = gridView.Columns["FK_ICStockID"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
            }
            column = gridView.Columns["ARSaleOrderItemStockLotNo"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = false;
            }
            column = gridView.Columns["ARSaleOrderItemGrantedFrom"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = false;
            }
            column = gridView.Columns["FK_ARSaleOrderID"];
            if (column != null)
            {
                column.Group();
            }
            return(gridView);
        }
Пример #8
0
        protected override void AddColumnsToGridView(string strTableName, GridView gridView)
        {
            base.AddColumnsToGridView(strTableName, gridView);
            GridColumn column = new GridColumn();

            column.Caption   = "Tên nhân viên";
            column.FieldName = "EmployeeName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Thứ";
            column.FieldName = "ThName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Bộ phận";
            column.FieldName = "HRDepartmentRoomName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Tổ";
            column.FieldName = "HRDepartmentRoomGroupItemName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Nhóm chấm công";
            column.FieldName = "HREmployeePayrollFormulaName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Vào/Ra";
            column.FieldName = "HRTimeKeeperCompleteInOutMode";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Xóa dữ liệu";
            column.FieldName = "DiscardItem";
            RepositoryItemHyperLinkEdit rep = new RepositoryItemHyperLinkEdit();

            rep.NullText      = "Hủy";
            rep.LinkColor     = Color.Blue;
            rep.Click        += new EventHandler(rep_Click);
            column.ColumnEdit = rep;
            gridView.Columns.Add(column);

            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompletesEmployeeCardNo"];
            if (column != null)
            {
                column.Group();
            }

            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompleteDate"];
            if (column != null)
            {
                column.Group();
            }

            column           = new GridColumn();
            column.Caption   = "Ca làm việc";
            column.FieldName = "FK_ADWorkingShiftID";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column = gridView.Columns["FK_ADWorkingShiftID"];
            if (column != null)
            {
                column.Group();
            }
        }
Пример #9
0
        protected override void AddColumnsToGridView(string strTableName, GridView gridView)
        {
            base.AddColumnsToGridView(strTableName, gridView);
            GridColumn column = new GridColumn();

            column.Caption   = "Tên nhân viên";
            column.FieldName = "EmployeeName";
            column.OptionsColumn.AllowEdit = false;
            column.Group();
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Thứ";
            column.FieldName = "ThName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Vào/Ra";
            column.FieldName = "HRTimeKeeperCompleteInOutMode";
            column.OptionsColumn.AllowEdit = true;
            gridView.Columns.Add(column);

            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompleteTimeCheck"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
            }
            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompletesEmployeeCardNo"];
            if (column != null)
            {
                column.Group();
            }
            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompleteDate"];
            if (column != null)
            {
                column.Group();
            }
            column = gridView.Columns["HRTimeKeeperCompleteDateCheck"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
            }
            column = new GridColumn();
            column = gridView.Columns["HRTimeKeeperCompleteComment"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = true;
            }
            column = new GridColumn();
            column = gridView.Columns["FK_HRDepartmentID"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = false;
            }
            column = new GridColumn();
            column = gridView.Columns["FK_HRLevelID"];
            if (column != null)
            {
                column.OptionsColumn.AllowEdit = false;
            }

            column           = new GridColumn();
            column.Caption   = "Xóa dữ liệu";
            column.FieldName = "DiscardItem";
            RepositoryItemHyperLinkEdit rep = new RepositoryItemHyperLinkEdit();

            rep.NullText      = "Hủy";
            rep.LinkColor     = Color.Blue;
            rep.Click        += new EventHandler(rep_Click);
            column.ColumnEdit = rep;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Trùng giờ";
            column.FieldName = "SameDateTime";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            repositoryItemDateEdit = new DevExpress.XtraEditors.Repository.RepositoryItemDateEdit();

            // repositoryItemDateEdit
            repositoryItemDateEdit.AutoHeight = false;
            repositoryItemDateEdit.DisplayFormat.FormatString = "HH:mm:ss";
            repositoryItemDateEdit.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
            repositoryItemDateEdit.Mask.EditMask = "HH:mm:ss";
            repositoryItemDateEdit.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            repositoryItemDateEdit.Name          = "repositoryItemDateEdit1";

            column           = new GridColumn();
            column.Caption   = "Bộ phận";
            column.FieldName = "HRDepartmentRoomName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Tổ";
            column.FieldName = "HRDepartmentRoomGroupItemName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Nhóm chấm công";
            column.FieldName = "HREmployeePayrollFormulaName";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Mã màu";
            column.FieldName = "RowColor";
            column.OptionsColumn.AllowEdit = false;
            gridView.Columns.Add(column);
        }