title: How to apply column alignment to datagrid
body: <p>I have an VB.Net ASP page that I have a datagrid on it with 5 columns and a few rows of data. The page will show the data and grid just fine.  I need to now apply alignment to the datagrid columns.</p>
  
  <pre><code>dgLast5Bills.DataSource = dtBill
  dgLast5Bills.DataBind()
  dgLast5Bills.Columns(0).ItemStyle.HorizontalAlign = HorizontalAlign.Center
  </code></pre>
  
  <p>The code above will error out when it hits the line for the alignment.  What am I doing wrong?  </p>
  
  <p>Thanks</p>