B
Belee
I am doing calculation in a data grid and I get the
following error message: "Input format not in correct
format".
The following is the code in c#
private void
dgSalesInvoice_CurrentCellChanged(object sender,
System.EventArgs e)
{
decimal result = 0;
decimal price = 0;
decimal qty = 0;
try
{
price = Convert.ToDecimal
(this.dtcPrice.TextBox.Text);
qty = Convert.ToDecimal
(this.dtcQuantity.TextBox.Text);
result = price * qty;
this.dtcAmount.TextBox.Text = result.ToString();
}
catch (Exception eC)
{
MessageBox.Show
(eC.Message, eC.GetType().ToString(),
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
The datagrid uses TableStyles. I need help please.
following error message: "Input format not in correct
format".
The following is the code in c#
private void
dgSalesInvoice_CurrentCellChanged(object sender,
System.EventArgs e)
{
decimal result = 0;
decimal price = 0;
decimal qty = 0;
try
{
price = Convert.ToDecimal
(this.dtcPrice.TextBox.Text);
qty = Convert.ToDecimal
(this.dtcQuantity.TextBox.Text);
result = price * qty;
this.dtcAmount.TextBox.Text = result.ToString();
}
catch (Exception eC)
{
MessageBox.Show
(eC.Message, eC.GetType().ToString(),
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
The datagrid uses TableStyles. I need help please.