extension method parameter in gridview databind
<p>I'm binding an object to a gridview. The object (LeClient) consists of several variables, two of which are related to its phone number. One variable contains a string of digits (LePhone) and the other contains an int that represents the country code (LeCountryCode). I have an extension method for strings that works to format the string LePhone and that I'd like to pass it LeCountryCode as the parameter.</p>

<p>So far, on RowDataBound I have an event handler with the following line:</p>

<pre><code>e.Row.Cells[5].Text = (string)(e.Row.Cells[5].Text).ToPhoneFormat(1);
</code></pre>

<p>I'd like to replace the 1 with the corresponding country code that's stored in the object LeClient associated with the row. How does this work? I tried </p>

<pre><code>.ToPhoneFormat(e.Row.DataItem("LeCountryCode"));
</code></pre>

<p>but it's not giving me the expected result.</p>

<p>Thanks</p>
