Question how to find sum of column in listview?

Joined
Dec 16, 2020
Messages
8
Programming Experience
Beginner
C#:
String[] arr = new String[4];
arr[0] = pname.Text;
arr[2] = qtytextBox.Text;
arr[1] = pricy.Text;
double f1, g1, j;

double.TryParse(qtytextBox.Text, out f1);
double.TryParse(pricy.Text, out g1);

j = f1 * g1;

if (j > 0)
    arr[3] = j.ToString();

ListViewItem listy = new ListViewItem(arr);
listView1.Items.Add(listy);
 
Last edited by a moderator:
See post 4.
 
You need to elaborate on that.
 
Code in post 4 is perfect for that. columnIndex for 4th column is 3.
 
Yes, you've stated that already. And you just keep stating that post #4 does not work. Since we are not psychic or clairvoyant, we cannot see what you are describing as "not working". Are you getting an error? If so what is the error? Are you getting unexpected results? If so what results are you getting? Is your best friend who asked to sleep on your couch for 3 days while he is looking for a new job still "not working" 6 months later? Does your droid have a bad motivator?

Although the last few question was asked in sarcasm, it was also meant to highlight how vague your "not working" description is.
 
Back
Top Bottom