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();
            }
        }
        private void cambiartextbox()
        {
            if (CHKCambiarcantidad.Checked == true)
            {
                if (indice < 0)
                {
                    GDDetalleretiro.Rows[GDDetalleretiro.Rows.Count - 1].Cells[3].Selected = true;
                }
                else
                {
                    GDDetalleretiro.Rows[indice].Cells[3].Selected = true;
                }

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


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

                TxtcambioDv.Visible = true;
                TxtcambioDv.Text    = GDDetalleretiro.CurrentCell.Value.ToString();
                TxtcambioDv.Focus();
            }
            else
            {
                Txtitems.Focus();
            }
        }
Exemplo n.º 3
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();
                }
            }
        }