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_ CurrentCellChan ged(object sender,
System.EventArg s e)
{
decimal result = 0;
decimal price = 0;
decimal qty = 0;
try
{
price = Convert.ToDecim al
(this.dtcPrice. TextBox.Text);
qty = Convert.ToDecim al
(this.dtcQuanti ty.TextBox.Text );
result = price * qty;
this.dtcAmount. TextBox.Text = result.ToString ();
}
catch (Exception eC)
{
MessageBox.Show
(eC.Message, eC.GetType().To String(),
MessageBoxButto ns.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_ CurrentCellChan ged(object sender,
System.EventArg s e)
{
decimal result = 0;
decimal price = 0;
decimal qty = 0;
try
{
price = Convert.ToDecim al
(this.dtcPrice. TextBox.Text);
qty = Convert.ToDecim al
(this.dtcQuanti ty.TextBox.Text );
result = price * qty;
this.dtcAmount. TextBox.Text = result.ToString ();
}
catch (Exception eC)
{
MessageBox.Show
(eC.Message, eC.GetType().To String(),
MessageBoxButto ns.OK, MessageBoxIcon. Error);
}
}
The datagrid uses TableStyles. I need help please.
Comment