Exemplo n.º 1
0
        private void cambiartextbox()
        {
            if (chkporcantidad.Checked == true)
            {
                if (indice < 0)
                {
                    DGDetalleitems.Rows[DGDetalleitems.Rows.Count - 1].Cells[3].Selected = true;
                }
                else
                {
                    DGDetalleitems.Rows[indice].Cells[3].Selected = true;
                }

                //  DGDetalleitems.Rows[DGDetalleitems.CurrentCell.RowIndex].Selected = true;
                Rectangle rec = DGDetalleitems.GetCellDisplayRectangle(DGDetalleitems.CurrentCell.ColumnIndex, DGDetalleitems.CurrentCell.RowIndex, false);
                DGDetalleitems.Focus();


                TxtcambioDv.Location = new Point(rec.Location.X + DGDetalleitems.Location.X, rec.Location.Y + DGDetalleitems.Location.Y);

                TxtcambioDv.Visible = true;
                TxtcambioDv.Text    = DGDetalleitems.CurrentCell.Value.ToString();
                TxtcambioDv.Focus();
            }
            else
            {
                txtNombreProducto.Focus();
            }
        }
Exemplo n.º 2
0
        private void DGDetalleitems_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Rectangle rec = DGDetalleitems.GetCellDisplayRectangle(DGDetalleitems.CurrentCell.ColumnIndex, DGDetalleitems.CurrentCell.RowIndex, false);

            //e.ColumnIndex == 2 || parametrizacion
            if (DGDetalleitems.Rows.Count > 0)
            {
                if (e.ColumnIndex == 3)
                {
                    datagriddobleclic    = true;
                    TxtcambioDv.Location = new Point(rec.Location.X + DGDetalleitems.Location.X, rec.Location.Y + DGDetalleitems.Location.Y);
                    // preciocantidad = "Cprecio";
                    TxtcambioDv.Visible = true;
                    TxtcambioDv.Text    = DGDetalleitems.CurrentCell.Value.ToString();
                    TxtcambioDv.Focus();
                }
            }
        }