Click here to Skip to main content
15,936,265 members
Home / Discussions / C#
   

C#

 
AnswerRe: User Control function C# Pin
Ralf Meier28-Jul-20 21:04
mveRalf Meier28-Jul-20 21:04 
GeneralRe: User Control function C# Pin
Ismael_199929-Jul-20 10:04
Ismael_199929-Jul-20 10:04 
GeneralRe: User Control function C# Pin
Ralf Meier29-Jul-20 20:30
mveRalf Meier29-Jul-20 20:30 
GeneralRe: User Control function C# Pin
Ismael_199930-Jul-20 4:03
Ismael_199930-Jul-20 4:03 
GeneralRe: User Control function C# Pin
Ralf Meier30-Jul-20 6:15
mveRalf Meier30-Jul-20 6:15 
GeneralRe: User Control function C# Pin
Ismael_199931-Jul-20 6:47
Ismael_199931-Jul-20 6:47 
GeneralRe: User Control function C# Pin
Gerry Schmitz31-Jul-20 7:48
mveGerry Schmitz31-Jul-20 7:48 
GeneralRe: User Control function C# Pin
Ismael_199931-Jul-20 10:36
Ismael_199931-Jul-20 10:36 
GeneralRe: User Control function C# Pin
Ralf Meier31-Jul-20 8:22
mveRalf Meier31-Jul-20 8:22 
GeneralRe: User Control function C# Pin
Ismael_199931-Jul-20 10:39
Ismael_199931-Jul-20 10:39 
GeneralRe: User Control function C# Pin
Ralf Meier31-Jul-20 11:20
mveRalf Meier31-Jul-20 11:20 
GeneralRe: User Control function C# Pin
Ismael_19991-Aug-20 1:57
Ismael_19991-Aug-20 1:57 
GeneralRe: User Control function C# Pin
Ralf Meier1-Aug-20 22:49
mveRalf Meier1-Aug-20 22:49 
Questioncall a jquery function inside html returned by ajax Pin
Peq 227-Jul-20 21:36
Peq 227-Jul-20 21:36 
AnswerRe: call a jquery function inside html returned by ajax Pin
OriginalGriff27-Jul-20 22:02
mveOriginalGriff27-Jul-20 22:02 
QuestionAdd a listview cell Pin
ago248627-Jul-20 1:34
ago248627-Jul-20 1:34 
AnswerRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:28
mveOriginalGriff27-Jul-20 2:28 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 2:31
ago248627-Jul-20 2:31 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:59
mveOriginalGriff27-Jul-20 2:59 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 3:18
ago248627-Jul-20 3:18 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 3:37
mveOriginalGriff27-Jul-20 3:37 
So use the debugger to find out!
Start by breakpointing the line itself:
C#
total_achat += Convert.ToDecimal(dataGridView1.Rows[i].Cells[4].Value);

When it hits for the first time, the total and the loop index should both be zero because that is what your code told them to be:
C#
total_achat = 0;
...
for (int i = 0; i < dataGridView1.Rows.Count; i++)
After it, you will have added the cell value, so step over that line.
What's the value of the total now? If it's still zero, then it means that this code evaluates to zero:
C#
Convert.ToDecimal(dataGridView1.Rows[i].Cells[4].Value)
So look at why that is: what's the value of dataGridView1.Rows[i].Cells[4].Value - use the debugger to find out by firstly hovering over word "Value" and if that looks "right" then adding the calculation to teh Watch pane.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:08
ago248627-Jul-20 4:08 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 4:38
mveOriginalGriff27-Jul-20 4:38 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:45
ago248627-Jul-20 4:45 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:53
ago248627-Jul-20 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.