Hi
pls help the code of below
column1 column2
10 apple
2 mango
4 apple
1 mango
3 orange
2 mango
-------------
22
--------------
i want to seperate the sum of item wise value wise like
apple = label1.text = 14 (10+4)
mango = label2.text = 5 (2+1+2)
orage = label3.text = 3
thanks in advance
Muhammad Imran AnsariPosted Sep 29, 2024, 7:16 AM
Hi Luv,
You can iterate through the DataGridView to retrieve the values for each key, and then store those values in a dictionary or another collection for further use. In this example, I am using a dictionary based on your scenario. Here is the code; you can modify it according to the grid columns and label names.
Thank you.