title: Centering the data in a cell in grid view
body: <p>I have a gridview and i'm associating the datasource for the grid view dynamically at runtime</p>
  
  <p>I mean </p>
  
  <pre><code> gridView2.DataSource = titlesArrayList;
   gridView2.DataBind();
  </code></pre>
  
  <p>And i want the data in cells of this grid view to be centered, right now they are left-justified</p>
  
  <p>If i was associating data through </p>
  
  <pre><code>&lt;asp:BoundField /&gt;
  </code></pre>
  
  <p>I have this property </p>
  
  <pre><code>ItemStyle-HorizontalAlign="Center"
  </code></pre>
  
  <p>But how can i access this property if the gridview is associated dynamically</p>
  
  <p>I hope u understand my problem</p>
  
  <p>Thanks in anticipation</p>