Get binding column name of templatefield's texbox
<p>In ASP.net, I'm using textbox in templatefield's itemtemplate. I got it data-bound with no problem.
But my problem is, I'm trying to write a function to find column index by its data-bounding table's column name.</p>

<p>Something like this :</p>

<pre><code>foreach (DataControlFieldCell cell in row.Cells)
{               
  if (cell.ContainingField is BoundField)
  {
    if (((BoundField)cell.ContainingField).DataField.Equals(SearchColumnName))
    {
      return columnIndex;
    }
  }
  else if (cell.ContainingField is TemplateField)
  {
    //Finding column name of data-bound textbox or dropdownlist ??
  }
}
</code></pre>
