Ok so i have a lil function that will get a value from a field in each row of a datagridview……….
then look at what the value is and count an according increment.
heres the code so far:
private void countParetoQty(int top, int tmid, int bmid, int bot )
{
//bunch of Ifs to count a record thats certain pareto
foreach(DataGridViewRow row in dataGridView1)
{
if(//current row @ pareto <=50)
{
//top 50
top++;
}
else
if()
{
//50-100
tmid++;
}
else
if()
{
//100-200
bmid++;
}
else
{
//its over 200!!!!!!!!!!!!!!
bot++;
}
}
as you can see i need to check the fields value “Pareto” on each row and cycle through afew If statements to increment the correct int.
I need to know how i get the value im looking for an cycle through.
Im thinking along the lines of foreach loop then conditioning by the current rows column.value?
Many thanks in advance!
You can access a cell value as following:
or by index