title: ASP.NET GridView TemplateField Call function(:int)
body: <p>My scenario is the following:</p>
  
  <p>I have a GridView and made a class the represents a row in it.
  I was expecting to show the properties and function's result of the class in the cells.</p>
  
  <p>For this i'm using columns like this:</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="1"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Label runat="server" text='&lt;%# MatchesCount((Int32)1) %&gt;' /&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>the class has the following function:</p>
  
  <pre><code>public class MatchesGridViewRow
  {
  ...
      public string MatchesCount(int day) {...}
  }
  </code></pre>
  
  <p>and I bind to the GridView like this:</p>
  
  <pre><code>GridView.DataSource = GetGridViewData(DateTime.Now.Month);
  GridViewCalendar.DataBind();    
  
  private List&lt;MatchesGridViewRow&gt; GetGridViewData(int month);
  </code></pre>
  
  <p>The error that I get is: 
  CS0103: The name 'MatchesCount' doesnt exist in current context.</p>
  
  <p>Isnt this the right way to call the method? If not how should i call it?
  Thanks from now, looking forware to answers.</p>