Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
When the user chooses an item to purchase they should be able to specify the quantity and the total is specified, the problem is that the quantity does not increase and I don't seem to understand what can be the cause of that. 


What I have tried:

I have tried fixing it because I thought it was my database but still it does not give me the correct feedback.

-----
copied from comment
-----
C#
private void PlusOne_Click(object sender, EventArgs e)
{
  foreach (ListViewItem list in listView1.SelectedItems)
  {
    list.SubItems.Add(addBox.Text);
  }
}

private void addBox_TextChanged(object sender, EventArgs e)
{
  int addOne = int.Parse(addBox.Text);
}
Posted
Updated 16-Sep-19 10:24am
v2
Comments
Suvendu Shekhar Giri 16-Sep-19 15:27pm    
That's not enough information to help you out. Please share the piece of problematic code which may make your question clear.
Patrice T 16-Sep-19 15:28pm    
What kind of magic are we supposed to use to see your code?
Simphiwe_Magubane 16-Sep-19 15:35pm    
Here is the code for the user to enter a value manually into a textBox, and clicking the button (with the product selected) will update the quantity. There's no crash, but it doesn't do anything.

private void PlusOne_Click(object sender, EventArgs e)
{
foreach (ListViewItem list in listView1.SelectedItems)
{
list.SubItems.Add(addBox.Text);
}
}

private void addBox_TextChanged(object sender, EventArgs e)
{
int addOne = int.Parse(addBox.Text);
}
Patrice T 16-Sep-19 16:11pm    
Use Improve question to update your question.
So that everyone can pay attention to this information.
Mohibur Rashid 16-Sep-19 16:25pm    
What are you doing addOne variable in addBox_TextCahnged function?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900