コード例 #1
0
        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            try
            {
                var rowHandle = gridView1.FocusedRowHandle;

                var obj = gridView1.GetRowCellValue(rowHandle, "IDPRODUTO");

                frmAlteraQuantidade frm = new frmAlteraQuantidade(true, obj.ToString());
                frm.ShowDialog();
                AtualizaGrid();
            }
            catch (Exception)
            {
                MessageBox.Show("Selecione um item");
            }
        }
コード例 #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                var rowHandle = gridView1.FocusedRowHandle;

                var obj = gridView1.GetRowCellValue(rowHandle, "IDPRODUTO");

                if (obj != null)
                {
                    frmAlteraQuantidade frm = new frmAlteraQuantidade(true, obj.ToString());
                    frm.ShowDialog();
                    AtualizaGrid();
                }
                else
                {
                    MessageBox.Show("Por favor, selecione um registro", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Selecione um item");
            }
        }