private void dgvPurchase_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
try
{
int selRow = dgvPurchase.Rows.GetFirstRow(DataGridViewElementStates.Selected);
{
if (selRow > -1)
{
cbxMname.Text = dgvPurchase[1, selRow].Value.ToString();
cbxItemName.Text = dgvPurchase[2, selRow].Value.ToString();
cbxBatchNo .Text = dgvPurchase[3, selRow].Value.ToString();
dtpExpdate.Text = dgvPurchase[4, selRow].Value.ToString();
txtNosPBox .Text = dgvPurchase[5, selRow].Value.ToString();
txtTotBox.Text = dgvPurchase[6, selRow].Value.ToString();
txtFreeQty.Text = dgvPurchase[7, selRow].Value.ToString();
txtNetQty.Text = dgvPurchase[8, selRow].Value.ToString();
txtMrp.Text = dgvPurchase[9, selRow].Value.ToString();
txtDiscoPers.Text = dgvPurchase[10, selRow].Value.ToString();
txtShopMorgin .Text = dgvPurchase[17, selRow].Value.ToString();
txtNetRate .Text = dgvPurchase[16, selRow].Value.ToString();
txtMarginamt.Text = dgvPurchase[18, selRow].Value.ToString();
txtBasicRate .Text = dgvPurchase[12, selRow].Value.ToString();
txtVatPers .Text = dgvPurchase[13, selRow].Value.ToString();
//txtPurTotAmount.Text = dgvPurchase[11, selRow].Value.ToString();
txtnetwp.Text = dgvPurchase[22, selRow].Value.ToString();
txtmrpwpval.Text = dgvPurchase[21, selRow].Value.ToString();
cbxUnits.Text = dgvPurchase[25, selRow].Value.ToString();
txtMaxQty.Text = dgvPurchase[23, selRow].Value.ToString();
txtMinQty.Text = dgvPurchase[24, selRow].Value.ToString();
txttotqty.Text = dgvPurchase[26, selRow].Value.ToString();
}
}
}
catch (Exception ex)
{
MessageBox.Show("Uncommitted Row Selectin", "Invalid Selection", MessageBoxButtons.OK, MessageBoxIcon.Stop);
dgvPurchase.ClearSelection();
}
}
{
try
{
int selRow = dgvPurchase.Rows.GetFirstRow(DataGridViewElementStates.Selected);
{
if (selRow > -1)
{
cbxMname.Text = dgvPurchase[1, selRow].Value.ToString();
cbxItemName.Text = dgvPurchase[2, selRow].Value.ToString();
cbxBatchNo .Text = dgvPurchase[3, selRow].Value.ToString();
dtpExpdate.Text = dgvPurchase[4, selRow].Value.ToString();
txtNosPBox .Text = dgvPurchase[5, selRow].Value.ToString();
txtTotBox.Text = dgvPurchase[6, selRow].Value.ToString();
txtFreeQty.Text = dgvPurchase[7, selRow].Value.ToString();
txtNetQty.Text = dgvPurchase[8, selRow].Value.ToString();
txtMrp.Text = dgvPurchase[9, selRow].Value.ToString();
txtDiscoPers.Text = dgvPurchase[10, selRow].Value.ToString();
txtShopMorgin .Text = dgvPurchase[17, selRow].Value.ToString();
txtNetRate .Text = dgvPurchase[16, selRow].Value.ToString();
txtMarginamt.Text = dgvPurchase[18, selRow].Value.ToString();
txtBasicRate .Text = dgvPurchase[12, selRow].Value.ToString();
txtVatPers .Text = dgvPurchase[13, selRow].Value.ToString();
//txtPurTotAmount.Text = dgvPurchase[11, selRow].Value.ToString();
txtnetwp.Text = dgvPurchase[22, selRow].Value.ToString();
txtmrpwpval.Text = dgvPurchase[21, selRow].Value.ToString();
cbxUnits.Text = dgvPurchase[25, selRow].Value.ToString();
txtMaxQty.Text = dgvPurchase[23, selRow].Value.ToString();
txtMinQty.Text = dgvPurchase[24, selRow].Value.ToString();
txttotqty.Text = dgvPurchase[26, selRow].Value.ToString();
}
}
}
catch (Exception ex)
{
MessageBox.Show("Uncommitted Row Selectin", "Invalid Selection", MessageBoxButtons.OK, MessageBoxIcon.Stop);
dgvPurchase.ClearSelection();
}
}
No comments:
Post a Comment