private void _gdSUB_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns["PART_UNITCOST_START_DATE"], DateTime.Today);
     view.SetRowCellValue(e.RowHandle, view.Columns["PART_UNITCOST_END_DATE"], DateTime.Parse("9999-12-31"));
     view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
 }
Exemple #2
0
        public void AddRow(DevExpress.XtraGrid.Views.Grid.GridView View)
        {
            int currentRow;

            currentRow = View.FocusedRowHandle;

            if (currentRow < 0)
            {
                currentRow = View.GetDataRowHandleByGroupRowHandle(currentRow);
            }

            if (View.GroupedColumns.Count == 0)
            {
                return;
            }

            string grp = View.GetRowCellValue(currentRow, colGRP).ToString();

            GenelDataSet.XGTRow xgtRow = this.genelDataSet.XGT.FindByGRPID(grp, "+");

            if (xgtRow.SYS == "M" || xgtRow.SYS == "V")   // Grup Modify ise eklenebilir
            {
                View.AddNewRow();

                View.SetRowCellValue(View.FocusedRowHandle, colGRP, grp);
                View.SetRowCellValue(View.FocusedRowHandle, colID, "");
                View.SetRowCellValue(View.FocusedRowHandle, colSYS, "V");   // User Modify

                View.UpdateCurrentRow();
                View.MakeRowVisible(View.FocusedRowHandle, true);
                View.ShowEditor();
            }
        }
Exemple #3
0
        private void _gdMAIN_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            view = sender as DevExpress.XtraGrid.Views.Grid.GridView;

            view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
            view.SetRowCellValue(e.RowHandle, view.Columns["INSPECT_ITEM"], "QC120001");
            view.SetRowCellValue(e.RowHandle, view.Columns["INSPECT_FIXTURE"], "QC130001");
        }
 private void _gdMAIN_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns["LANGUAGE_TYPE"], "한국어");
     view.SetRowCellValue(e.RowHandle, view.Columns["CODE_TYPE"], "1003");
     view.SetRowCellValue(e.RowHandle, view.Columns["FIELD_KEY"], "N");
     view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
 }
Exemple #5
0
        private void gridView1_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            bindingSourceUsers.DataSource = db.Users.Where(s => s.IsEnable == true).ToList();

            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            view.SetRowCellValue(e.RowHandle, view.Columns["Date"], DateTime.Now);
            view.SetRowCellValue(e.RowHandle, view.Columns["UserID"], UserData.Default.UserID);
        }
Exemple #6
0
        private void _gdSUB_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            //if (_luDOCUMENT_TYPE.Text.ToString() == "") return;

            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            view.SetRowCellValue(e.RowHandle, view.Columns["DOCUMENT_TYPE"], _luDOCUMENT_TYPE.GetValue().ToString());
            view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
            view.SetRowCellValue(e.RowHandle, view.Columns["PART_CODE"], _luPART_CODE2.Text.ToString());

            //string a = _luDOCUMENT_TYPE.GetValue().ToString();

            if (_luDOCUMENT_TYPE.GetValue().ToString() == "")
            {
                CoFAS_DevExpressManager.ShowErrorMessage(_pMSG_CHECK_VALID_ITEM);
            }
        }
        /// <summary>
        /// 全选/全不选
        /// </summary>
        /// <param name="gridView"></param>
        /// <param name="fieldName"></param>
        /// <param name="currentStatus"></param>
        /// <returns></returns>
        private bool ClickGridCheckBox(DevExpress.XtraGrid.Views.Grid.GridView gridView, string fieldName, bool currentStatus)
        {
            try
            {
                bool result = false;

                if (gridView != null)
                {
                    gridView.PostEditor();

                    DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info;

                    Point pt = gridView.GridControl.PointToClient(Control.MousePosition);

                    info = gridView.CalcHitInfo(pt);

                    if (info.InColumn && info.Column != null && info.Column.FieldName == fieldName)
                    {
                        for (int i = 0; i < gridView.RowCount; i++)
                        {
                            gridView.SetRowCellValue(i, fieldName, !currentStatus);
                        }

                        return(true);
                    }
                }

                return(result);
            }
            catch
            {
                return(false);
            }
        }
Exemple #8
0
        void grdCtlMain_BeforeContextMenuClick(object sender, MB.XWinLib.XtraGrid.GridControlExMenuEventArg arg)
        {
            if (arg.MenuType == MB.XWinLib.XtraGrid.XtraContextMenuType.Copy)
            {
                arg.Handled = true;

                dataCopy();
            }
            else if (arg.MenuType == MB.XWinLib.XtraGrid.XtraContextMenuType.Past)
            {
                arg.Handled = true;

                IDataObject data = Clipboard.GetDataObject();

                object ss = data.GetData(typeof(string));
                dataPast(ss.ToString());
            }
            else if (arg.MenuType == XtraContextMenuType.DataImport)
            {
                arg.Handled = true;
                dataImport();
            }
            else if (arg.MenuType == XtraContextMenuType.QuickInput)
            {
                arg.Handled = true;

                if (arg.Column != null)
                {
                    DevExpress.XtraGrid.Views.Grid.GridView gridView = gridViewMain;
                    if (arg.Column.OptionsColumn.AllowEdit && gridView.FocusedRowHandle >= 0)
                    {
                        var dre = MB.WinBase.MessageBoxEx.Question("是否决定以当前选择列的值进行快速填充");
                        if (dre != DialogResult.Yes)
                        {
                            return;
                        }

                        DataRow entity = gridView.GetDataRow(gridView.FocusedRowHandle);
                        object  val    = entity[arg.Column.FieldName];
                        if (val != null)
                        {
                            int count = gridView.RowCount;
                            for (int i = 0; i < count; i++)
                            {
                                DataRow dr = gridView.GetDataRow(i);
                                GridRowCellEditEventArgs cellarg = new GridRowCellEditEventArgs(dr, arg.Column);
                                cellarg.AllowEdit = arg.Column.OptionsColumn.AllowEdit;
                                OnRowCellEditForEditing(cellarg);
                                if (cellarg.AllowEdit)
                                {
                                    gridView.SetRowCellValue(i, arg.Column.FieldName, val);
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #9
0
        public void loadbangkehangtheongay(string ngaychungtu, string ngaycuoi, string manhanvien, DevExpress.XtraGrid.Views.Grid.GridView gridView1)
        {
            while (gridView1.RowCount > 1)
            {
                gridView1.DeleteRow(0);
            }
            manhanvien = gen.GetString("select AccountingObjectID from AccountingObject where AccountingObjectCode='" + manhanvien + "'");

            DataTable temp = gen.GetTable("select '131','1111',AccountingObjectCode,SUM(TotalAmountOC+TotalAmount-(TotalFreightAmount/(1+Cast(Tax as money)/100))) as tien from INOutward a, AccountingObject b where a.AccountingObjectID=b.AccountingObjectID and RefDate>='" + ngaychungtu + "' and RefDate<='" + ngaycuoi + "' and EmployeeIDSA='" + manhanvien + "' and IsExport=1 group by AccountingObjectCode order by AccountingObjectCode");

            for (int i = 0; i < temp.Rows.Count; i++)
            {
                gridView1.AddNewRow();
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Tài khoản có"], temp.Rows[i][0].ToString());
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Tài khoản nợ"], temp.Rows[i][1].ToString());
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Số tiền"], Double.Parse(temp.Rows[i][3].ToString()));
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Mã khách"], temp.Rows[i][2].ToString());
                gridView1.UpdateCurrentRow();
            }
        }
        private void _gdMAIN_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            if (CoFAS_ConvertManager.DataTable_FindCount(_gdSUB_VIEW.GridControl.DataSource as DataTable, "CRUD IN ('C','U','D')", ""))
            {
                CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_WORKING);
                return;
            }

            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;

            view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
        }
        private void _gdSUB_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            //if (_luBAD_GROUP_CODE.Text == "")
            //{
            //    CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_CHECK_VALID_ITEM);
            //    return;
            //}

            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;

            //view.SetRowCellValue(e.RowHandle, view.Columns["BAD_GROUP_CODE"], _luBAD_GROUP_CODE.Text);

            view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
        }
Exemple #12
0
        private void _gdSUB_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            //if (CoFAS_ConvertManager.DataTable_FindCount(_gdMAIN_VIEW.GridControl.DataSource as DataTable, "CRUD IN ('C','U','D')", ""))
            //{
            //    CoFAS_DevExpressManager.ShowInformationMessage(_pMSG_WORKING);
            //    return;
            //}

            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;

            //view.SetRowCellValue(e.RowHandle, view.Columns["EQUIPMENT_STOP_GROUP_CODE"], _gdMAIN_VIEW.GetFocusedRowCellValue("EQUIPMENT_STOP_GROUP_CODE").ToString());

            view.SetRowCellValue(e.RowHandle, view.Columns["USE_YN"], "Y");
        }
Exemple #13
0
        void _XtraGrid_BeforeContextMenuClick(object sender, MB.XWinLib.XtraGrid.GridControlExMenuEventArg arg)
        {
            if (arg.MenuType == XtraContextMenuType.QuickInput)
            {
                arg.Handled = true;

                if (arg.Column == null)
                {
                    return;
                }

                DevExpress.XtraGrid.Views.Grid.GridView gridView = _AdvBandGridView;
                if (!arg.Column.OptionsColumn.AllowEdit || gridView.FocusedRowHandle < 0)
                {
                    return;
                }

                if (gridView.SortedColumns.Contains(arg.Column))
                {
                    MB.WinBase.MessageBoxEx.Show("当前列正在排序状态,不能进行快速填充.请先取消排序");
                    return;
                }

                var dre = MB.WinBase.MessageBoxEx.Question("是否决定以当前选择列的值进行快速填充");
                if (dre != DialogResult.Yes)
                {
                    return;
                }

                DataRow entity = gridView.GetDataRow(gridView.FocusedRowHandle);
                object  val    = entity[arg.Column.FieldName];

                if (val == null)
                {
                    return;
                }

                int count = gridView.RowCount;
                for (int i = 0; i < count; i++)
                {
                    //判断当前列是否可以编辑
                    if (!checCanEdit(i, arg.Column.FieldName))
                    {
                        continue;
                    }

                    gridView.SetRowCellValue(i, arg.Column.FieldName, val);
                }
            }
        }
Exemple #14
0
        void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            try
            {
                if (view == null)
                {
                    return;
                }
                //int count = (dtDetalleSolicitud.Rows.Count > 0) ? dtDetalleSolicitud.AsEnumerable().Max(a => a.Field<int>("Linea")) + 1 : 1;

                view.SetRowCellValue(e.RowHandle, view.Columns["IDSolicitud"], IDSolicitud);
                //view.SetRowCellValue(e.RowHandle, view.Columns["Linea"], count);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #15
0
        /// <summary>
        /// 单击表格空间列头按钮
        /// </summary>
        /// <param name="gridView"></param>
        /// <param name="fieldName"></param>
        /// <param name="currentStatus"></param>
        /// <returns></returns>
        public bool ClickGridCheckBox(DevExpress.XtraGrid.Views.Grid.GridView gridView, bool currentStatus)
        {
            bool result = false;

            if (gridView != null)
            {
                gridView.ClearSorting();//禁止排序

                gridView.PostEditor();
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info;
                Point pt = gridView.GridControl.PointToClient(Control.MousePosition);
                info = gridView.CalcHitInfo(pt);
                if (info.InColumn && info.Column != null && info.Column.FieldName == _column.FieldName)
                {
                    for (int i = 0; i < gridView.RowCount; i++)
                    {
                        gridView.SetRowCellValue(i, _column, !currentStatus);
                    }
                    return(true);
                }
            }
            return(result);
        }
Exemple #16
0
 private void grv_TTLL_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView View = (DevExpress.XtraGrid.Views.Grid.GridView)sender;
     View.SetRowCellValue(e.RowHandle, View.Columns["MASO"], grv_TTLL.RowCount);
 }
Exemple #17
0
 private void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     model.ART011 = string.IsNullOrEmpty(tableBody.Compute("MAX(ART011)", null).ToString( )) == true ? "001" : (Convert.ToInt32(tableBody.Compute("MAX(ART011)", null)) + 1).ToString( ).PadLeft(3, '0');
     view.SetRowCellValue(e.RowHandle, view.Columns ["ART011"], model.ART011);
 }
Exemple #18
0
 private void gridView4_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns ["ARU002"], _bodyOne.ARU002);
     view.SetRowCellValue(e.RowHandle, view.Columns ["ART003"], _bodyOne.ARU005);
 }
Exemple #19
0
 private void _gdMAIN_VIEW_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     //view.SetRowCellValue(e.RowHandle, view.Columns["LANGUAGE_TYPE"], "한국어");
     view.SetRowCellValue(e.RowHandle, view.Columns["PROCESS_CODE"], _pPROCESS_CODE);
 }
Exemple #20
0
 private void gridView2_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, colرقمالكشف1, lastNum + 1);
 }
 private void gridView3_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns["AlertType"], "ทวงถามดอกเบี้ย");
 }
Exemple #22
0
 private void gridView1_InitNewRow(object sender, InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns["Date"], DateTime.Now);
 }
Exemple #23
0
 private void gridViewDetalle_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     view.SetRowCellValue(e.RowHandle, view.Columns["NumSolicitud"], _currentRow["NumSolicitud"]);
     view.SetRowCellValue(e.RowHandle, view.Columns["CodSucursal"], _currentRow["CodSucursal"]);
 }