Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

C# have a combobox divide data in a datagridview column

$
0
0

I have a datagridview say column [8] that has information in the column. I would like to have a  combobox when selected change the value. It would divide the number say 2500 in column [8] divided by .5 = 5000. This is how I'm doing  some of my code doing calculation. I dont know how to add the combobox to do the calculation.

Need help

thanks

 int Float = Convert.ToInt32(dgv.Rows[i].Cells[3].Value ?? 0);
                decimal Daily_Usage = Convert.ToDecimal(dgv.Rows[i].Cells[8].Value ?? 0);
                var Op_Resv = Float == 0 ? 0 : Float * Daily_Usage;
                dgv.Rows[i].Cells[4].Value = Op_Resv;


Booney440


Viewing all articles
Browse latest Browse all 2535

Trending Articles