title: how to get column Index by column name?
body: <p>I have a datagrid having few columns-</p>
  
  <p>The header of the grid is hyperlink and I am setting its value at runtime as follows-</p>
  
  <pre><code>string strQ1 = "&lt;a href='somePage.aspx?ID=1'&gt;gfgytyty&lt;a&gt;";
  dtGrid.Columns[0].Header = strq1;
  
  string strQ2 = "&lt;a href='somePage.aspx?ID=2'&gt;yhtryrtuyu&lt;a&gt;";
  dtGrid.Columns[1].Header = strq2;
  
  and so on...
  </code></pre>
  
  <p>It is working properly.
  Now suppose I want to get index of a perticular column of datatgrid by its name but I am not able to get it.
  I tried</p>
  
  <pre><code>int  colIndex = dtGrid.Columns.IndexOf(dtGrid.Columns[strQ2]);
  </code></pre>
  
  <p>this should return 1 as columnIndex but it is returning -1,</p>
  
  <p><strong>Also, dtGrid.Columns[strQ2] giving me the null value.</strong></p>
  
  <p>what I am doing wrong here?</p>