Exemplo n.º 1
0
 private void gridUsers_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (this.gridUsers.CurrentColumn is GridViewMultiComboBoxColumn)
     {
         if (!maNhanVienColumnAdded)
         {
             maNhanVienColumnAdded = true;
             GridViewMultiComboBoxColumn   column = this.gridUsers.CurrentColumn as GridViewMultiComboBoxColumn;
             RadMultiColumnComboBoxElement editor = (RadMultiColumnComboBoxElement)this.gridUsers.ActiveEditor;
             FilterDescriptor descriptorCode      = new FilterDescriptor("FirstName", FilterOperator.StartsWith, string.Empty);
             editor.EditorControl.FilterDescriptors.Add(descriptorCode);
             editor.AutoFilter = true;
             editor.EditorControl.MasterTemplate.AutoGenerateColumns = false;
             GridViewTextBoxColumn col = new GridViewTextBoxColumn();
             col.IsVisible = false;
             col.FieldName = "Employee_ID";
             editor.EditorControl.Columns.Add(col);//new GridViewTextBoxColumn("Employee_ID"));
             editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("FirstName"));
             editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("LastName"));
             col = new GridViewTextBoxColumn("FullName");
             editor.EditorControl.Columns.Add(col);
             col.Expression = "FirstName + ' ' + LastName";
             editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("Birthday"));
             editor.AutoSizeDropDownToBestFit = true;
         }
     }
 }
Exemplo n.º 2
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Row is GridViewFilteringRowInfo && e.Column.Name == "Priority")
     {
         e.Cancel = true;
     }
 }
Exemplo n.º 3
0
 void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (this.radGridView1.ActiveEditor is RadItem)
     {
         (this.radGridView1.ActiveEditor as RadItem).StretchVertically = false;
     }
 }
Exemplo n.º 4
0
        private void dgvData_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            try
            {
                if (e.Column.Name.Equals("Location"))
                {
                    /////////////มีการ เคลียร์ การ Add ก่อน แล้วค่อย Add ใหม่////////////////
                    //Row = e.RowIndex;
                    RadMultiColumnComboBoxElement Comcol = (RadMultiColumnComboBoxElement)e.ActiveEditor;
                    Comcol.Columns.Clear();

                    //RadMultiColumnComboBoxElement Comcol = (RadMultiColumnComboBoxElement)e.ActiveEditor;
                    Comcol.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
                    Comcol.DropDownWidth      = 150;
                    Comcol.DropDownHeight     = 150;
                    //Comcol.EditorControl.BestFitColumns(BestFitColumnMode.AllCells);
                    Comcol.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
                    //ปรับอัตโนมัติ
                    //Comcol.EditorControl.AutoGenerateColumns = false;
                    //Comcol.BestFitColumns(true, true);
                    Comcol.AutoFilter = true;

                    //Comcol.EditorControl.AllowAddNewRow = true;
                    Comcol.EditorControl.EnableFiltering = true;
                    Comcol.EditorControl.ReadOnly        = false;
                    Comcol.ClearFilter();


                    //Comcol.DisplayMember = "ItemNo";
                    //Comcol.ValueMember = "ItemNo";

                    // //----------------------------- ปรับโดยกำหนดเอง
                    Comcol.EditorControl.Columns.Add(new GridViewTextBoxColumn
                    {
                        HeaderText     = "สถานที่เก็บ",
                        Name           = "Code",
                        FieldName      = "Code",
                        Width          = 100,
                        AllowFiltering = true,
                        ReadOnly       = false
                    }
                                                     );
                    // Comcol.EditorControl.Columns.Add(new GridViewTextBoxColumn
                    // {
                    //     HeaderText = "Description",
                    //     Name = "Description",
                    //     FieldName = "Description",
                    //     Width = 300,
                    //     AllowFiltering = true,
                    //     ReadOnly = false

                    // }
                    //);


                    //dgvDataDetail.CellEditorInitialized += MasterTemplate_CellEditorInitialized;
                }
            }
            catch { }
        }
 private void printQueue_GridView_CellDoubleClick(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         DialogResult = DialogResult.OK;
     }
 }
        private void grdSurchargeRates_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (e.Column != null)
            {
                bool IsAmountWise = e.Row.Cells[COL_FARES.AMOUNTWISE].Value.ToBool();

                if (IsAmountWise && e.Column.Name == COL_FARES.PERCENTAGE)
                {
                    e.Cancel = true;
                }

                if (IsAmountWise == false && e.Column.Name == COL_FARES.AMOUNT)
                {
                    e.Cancel = true;
                }
                if (IsAmountWise)
                {
                    e.Row.Cells[COL_SURCHARGERATES.PERCENTAGE].Value = 0;
                }
                else
                {
                    e.Row.Cells[COL_SURCHARGERATES.AMOUNT].Value = 0;
                }
            }
        }
Exemplo n.º 7
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         this.idxStatic.DataSource = this.idxStaticValue;
         if (!this.rowAdded)
         {
             this.rowAdded = true;
         }
         else
         {
             return;
         }
         this.idxStaticValue.Add(this.agenda_variable.Count);
     }
     else
     {
         this.idxGridAwal = -1;
         if (e.ColumnIndex == 1)
         {
             int idxs;
             int.TryParse(this.radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out idxs);
             this.idxGridAwal = idxs;
         }
         else
         {
             this._strAwal = this.radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         }
         this.idxStatic.DataSource = this.idxStaticValueReal;
     }
 }
Exemplo n.º 8
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Row is GridViewFilteringRowInfo)
     {
         this.radGridView1.EnableCustomFiltering = false;
     }
 }
Exemplo n.º 9
0
 private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     //开始编辑,记录下value
     if (this.radGridView1.CurrentRow.Cells[1].Value != null)
     {
         keyMaterialCode = this.radGridView1.CurrentRow.Cells[1].Value.ToString();
     }
 }
Exemplo n.º 10
0
 private void grdIndicator_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (editingIndicatorValue_MaxUse == -1 && editingIndicatorValue_UnitPrice == -1)
     {
         editingIndicatorValue_MaxUse    = Convert.ToDouble(grdIndicator.Rows[e.RowIndex].Cells["Max_Use"].Value);
         editingIndicatorValue_UnitPrice = Convert.ToDouble(grdIndicator.Rows[e.RowIndex].Cells["Unit_Price"].Value);
     }
 }
Exemplo n.º 11
0
 private void radGridView3_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (NBConfig.GetGMIDPrinted())
     {
         e.Cancel = true;
         MessageBox.Show("Gaji telah di print maka perubahan data gaji sudah tidak diperbolehkan.");
     }
 }
Exemplo n.º 12
0
        void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            RadDateTimeEditor radeditor = this.radGridView1.ActiveEditor as RadDateTimeEditor;

            if (radeditor != null)
            {
                radeditor.CustomFormat = "F";
            }
        }
Exemplo n.º 13
0
        private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            var key = this.radGridView1.CurrentRow.Cells[1].Value;

            if (key != null)
            {
                this.keyTypeNo = key.ToString();
            }
        }
Exemplo n.º 14
0
 private void gvScholarshipDiscounts_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == 2)
         {
             oldS = gvScholarshipDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         }
     }
 }
Exemplo n.º 15
0
 private void gvSubjects_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == 2)
         {
             oldGL = gvSubjects.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         }
     }
 }
Exemplo n.º 16
0
        private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            RadDateTimeEditor editor = this.radGridView1.ActiveEditor as RadDateTimeEditor;

            if (editor != null)
            {
                ((RadItem)editor.EditorElement).ToolTipText = "Modify the date to filter the rows in the grid";
                editor.CustomFormat = "MMMM d, yyyy";
            }
        }
Exemplo n.º 17
0
 private void Dgv_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Column.Name == "Задняя стенка2" ||
         e.Column.Name == "Тип фасада2")
     {
         _columnName = e.Column.Name;
         ((RadDropDownListEditorElement)((RadDropDownListEditor)e.ActiveEditor).EditorElement).SelectedIndexChanged -= Form1_SelectedIndexChanged;
         ((RadDropDownListEditorElement)((RadDropDownListEditor)e.ActiveEditor).EditorElement).SelectedIndexChanged += Form1_SelectedIndexChanged;
     }
 }
Exemplo n.º 18
0
 private void grdPayment_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         if (e.Column.Name == "Pay_Date")
         {
             editingDate = grdPayment.Rows[e.RowIndex].Cells["Pay_Date"].Value.ToString();
         }
     }
 }
Exemplo n.º 19
0
 private void MasterTemplate_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.Column.Name.Equals("S"))
         {
             //e.Cancel = e.Row.Cells["Status"].Value.Equals("Over Due");
         }
     }
 }
Exemplo n.º 20
0
        private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            RadDropDownListEditor comboBoxEditor = this.radGridView1.ActiveEditor as RadDropDownListEditor;

            if (comboBoxEditor != null)
            {
                comboBoxEditor.EditorElement.StretchVertically = false;
                comboBoxEditor.DropDownStyle      = Telerik.WinControls.RadDropDownStyle.DropDownList;
                comboBoxEditor.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
            }
        }
Exemplo n.º 21
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Column.Name == "CustomColumn")
     {
         RadButtonElement radButtonElement = new RadButtonElement();
         radButtonElement.Font   = font;
         radButtonElement.Text   = "...";
         radButtonElement.Click += new EventHandler(radButtonElement_Click);
         this.radGridView1.CurrentCell.Children.Add(radButtonElement);
     }
 }
Exemplo n.º 22
0
        private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            try
            {
                if (e.Column.Name.Equals("UserID"))
                {
                    /////////////มีการ เคลียร์ การ Add ก่อน แล้วค่อย Add ใหม่////////////////
                    //Row = e.RowIndex;
                    RadMultiColumnComboBoxElement Comcol = (RadMultiColumnComboBoxElement)e.ActiveEditor;
                    Comcol.Columns.Clear();

                    //RadMultiColumnComboBoxElement Comcol = (RadMultiColumnComboBoxElement)e.ActiveEditor;
                    Comcol.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
                    Comcol.DropDownWidth      = 200;
                    Comcol.DropDownHeight     = 150;
                    //Comcol.EditorControl.BestFitColumns(BestFitColumnMode.AllCells);
                    Comcol.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
                    //ปรับอัตโนมัติ
                    //Comcol.EditorControl.AutoGenerateColumns = false;
                    //Comcol.BestFitColumns(true, true);
                    Comcol.AutoFilter = true;

                    //Comcol.EditorControl.AllowAddNewRow = true;
                    Comcol.EditorControl.EnableFiltering = true;
                    Comcol.EditorControl.ReadOnly        = false;
                    Comcol.ClearFilter();


                    //Comcol.DisplayMember = "ItemNo";
                    //Comcol.ValueMember = "ItemNo";

                    // //----------------------------- ปรับโดยกำหนดเอง
                    Comcol.EditorControl.Columns.Add(new GridViewTextBoxColumn
                    {
                        HeaderText     = "UserID",
                        Name           = "UserID",
                        FieldName      = "UserID",
                        Width          = 150,
                        AllowFiltering = true,
                        ReadOnly       = false
                    }
                                                     );
                    Comcol.EditorControl.Columns.Add(new GridViewTextBoxColumn
                    {
                        HeaderText = "UserName",
                        Name       = "UserName",
                        FieldName  = "UserName",
                        Width      = 200
                    });
                }
            }
            catch { }
        }
Exemplo n.º 23
0
        private void dgvOrderItems_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (e.Row.Cells[0].IsCurrent)
            {
                _productID    = e.Row.Cells[5].Value == null ? "" : e.Row.Cells[5].Value.ToString();
                _saleDetailID = e.Row.Cells[6].Value == null ? 0 : e.Row.Cells[6].Value.ToInt();

                SuscribeToEvent();
                frmChooseItem frm = new frmChooseItem();
                frm.PositionForm(dgvOrderItems.Top - 40, 380);
                frm.ShowDialog();
            }
        }
 private void grdDrivers_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     try
     {
         if (e.Column != null && e.Column.Name == "colDrv")
         {
             e.Cancel = true;
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 25
0
        private void RadGridView2_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            var materialStock     = this.radGridViewStock.CurrentRow.Cells[6].Value;
            var materialDescrible = this.radGridViewStock.CurrentRow.Cells[7].Value;

            if (materialStock != null)
            {
                keyOldMaterialStock = materialStock.ToString();
            }
            if (materialDescrible != null)
            {
                keyOldMaterialDescrible = materialDescrible.ToString();
            }
        }
Exemplo n.º 26
0
        private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            var key           = this.radGridView1.CurrentRow.Cells[1].Value;
            var key_name      = this.radGridView1.CurrentRow.Cells[2].Value;//名称/容量
            var key_describle = this.radGridView1.CurrentRow.Cells[5].Value;

            if (key == null && key_describle == null || key_name == null)//行不存在
            {
                return;
            }

            this.keyOldTypeNo      = key.ToString().Trim();
            this.keyDescrible      = key_describle.ToString().Trim();
            this.keyProductStorage = key_name.ToString().Trim();
        }
Exemplo n.º 27
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Row.Cells["TipeHadirID"].Value != null)
     {
         string frmName = this.GetType().Name;
         bool   delete  = NBConfig.CheckPermission((this.Tag != null? this.Tag.ToString():""), frmName, "delete");
         if (!delete)
         {
             //Can not modify absen kalo hari raya
             if (e.Row.Cells["TipeHadirID"].Value.ToString() == "7")
             {
                 e.Cancel = true;
             }
         }
     }
 }
Exemplo n.º 28
0
 private void MasterTemplate_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     try
     {
         beginQty = 0.00m;
         if (e.Row.Cells["OutQty"].Value.ToDecimal() <= 0)
         {
             e.Cancel = true;
         }
         else if (e.Column.Name.Equals("Qty"))
         {
             beginQty = e.Row.Cells["Qty"].Value.ToDecimal();
         }
     }
     catch { }
 }
Exemplo n.º 29
0
 private void dgvData_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.Column.Name.Equals("Def"))
         {
             if (!e.Row.Cells["Def"].Value.ToBool())
             {
                 dgvData.Rows.Where(x => x.Index != e.RowIndex).ToList().ForEach(x =>
                 {
                     x.Cells["Def"].Value  = false;
                     x.Cells["dgvC"].Value = "T";
                 });
             }
         }
     }
 }
        //private void btnLogin_Click(object sender, EventArgs e)
        //{
        //     LoginDriver();
        //}



        private void grdDrivers_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            try
            {
                if (e.Column != null && e.Column.Name == "colDrv")
                {
                    e.Cancel = true;
                }


                if (e.Column != null && e.Column.Name == "colChk" && e.Row is GridViewDataRowInfo && e.Row.Tag.ToStr() == "lock")
                {
                    e.Cancel = true;
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 31
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex == -1)
     {
         this.idxStatic.DataSource = this.idxStaticValue;
         if (!this.rowAdded)
             this.rowAdded = true;
         else
             return;
         this.idxStaticValue.Add(this.agenda_variable.Count);
     }
     else
     {
         this.idxGridAwal = -1;
         if(e.ColumnIndex==1)
         {
             int idxs;
             int.TryParse(this.radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out idxs);
             this.idxGridAwal = idxs;
         }
         else
             this._strAwal = this.radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         this.idxStatic.DataSource = this.idxStaticValueReal;
     }
 }
Exemplo n.º 32
0
        /// <summary>
        /// Gvs the parameter definition cell begin edit.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="Telerik.WinControls.UI.GridViewCellCancelEventArgs"/> instance containing the event data.</param>
        private void GvParameterDefinitionCellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            var editor = this.gvParameterDefinition.ActiveEditor as RadMaskedEditBoxEditor;
            if (editor != null)
            {
                if (e.RowIndex < 0 || e.ColumnIndex < 0)
                {
                    return;
                }

                if (this.gvParameterDefinition.Rows[e.RowIndex].Cells[e.ColumnIndex].Value == null)
                {
                    e.Cancel = true;
                    return;
                }

                if (string.IsNullOrEmpty(this.gvParameterDefinition.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()))
                {
                    e.Cancel = true;
                    return;
                }
            }

            var ckboxEditor = this.gvParameterDefinition.ActiveEditor as RadCheckBoxEditor;
            if (ckboxEditor != null)
            {
                // TODO: disable checkbox for parameters that are not autoincrement
            }
        }
Exemplo n.º 33
0
 private void gvScholarshipDiscounts_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == 2)
         {
             oldS = gvScholarshipDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
         }
     }
 }
Exemplo n.º 34
0
        private void gvSubjects_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                if (e.ColumnIndex == 3)
                {
                    oldGL = gvSubjects.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
                    if (subjects[e.RowIndex].SubjectID != 0)
                    {
                        e.Cancel = true;
                    }

                }
            }
        }