Passing data between a method and an event function : <p>Hello I have been struggling trying to get the event to trigger based on the object that it is passed.... I am not sure if that's how it should be worded but you guys can take a look at the book and give me some insight</p>

<p>I am making a datagrid form, inside this form, there's a function</p>

<pre><code>private void (List&lt;string&gt; listProducts&gt;
{
    foreach (aProduct in listProducts)
            {
                // reset row data
                rowProduct = new string[10];
                // add the row
                this.dataDisplay.Tables["ProductData"].Rows.Add(rowProduct);
                double checkingresult;
                checkingresult = checkDiameter(aProduct);
}

</code></pre>

<p>Inside this form there's a function that would check the validity of the test product, so checkingresult would return 0 or 1</p>

<p>Then I created an event button to click on to change the color of the cell in the datagrid when it is clicked</p>

<pre><code>
     private void bttnChecking_Click(object sender, EventArgs e)
        {


            DataGridViewCellStyle style = new DataGridViewCellStyle();
            style.Font = new Font(datagridProductData.Font, FontStyle.Bold);
            style.BackColor = Color.Red;
            style.ForeColor = Color.White;

            foreach (aProduct in ListProducts)
            {

            }
                for (int i = 0; i &lt; RowCount - 1; i++)
            {
                Rows[i].Cells[5].Style = style;

            }
        }
    }

</code></pre>

<p>my question is, how do I pass the "checkingresult" into the event to change the color when it returns 0 or 1. Pls halp </p>
