HorizontalAlign in gridview dynamically
<p>I have a <code>GrdiView</code> on an asp.net page. I am setting the datasource to a <code>DataTable</code>. I need to set <code>HorizontalAlign</code> to left if the value in the cell is of type string, else if it is a decimal, I want it to be aligned to the right. Please let me know how to implement this. The code for the <code>GridView</code> is as follows:</p>

<pre><code>      &lt;asp:GridView ID="gridViewReport" runat="server" Height="1px"       OnRowDataBound="UsersGVRowDataBound" GridLines="both" Style="z-index: 100; 
        left: 2px; position: absolute; top: 1px; " Width="939px" CellPadding="4"   ForeColor="#333333" AllowSorting="True" OnSorting="gridViewReport_Sorting" Font-Names="Verdana" Font-Size="12px" OnSelectedIndexChanged="gridViewReport_SelectedIndexChanged1"&gt;
        &lt;AlternatingRowStyle BackColor="White" /&gt;
        &lt;RowStyle HorizontalAlign="Left" BackColor="#EFECE5" /&gt;            
        &lt;FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /&gt;
        &lt;PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /&gt;
        &lt;SelectedRowStyle BackColor="#C0F6C0" ForeColor="#333333" Font-Bold="True" /&gt;
        &lt;HeaderStyle BackColor="#CDE472"  Font-Bold="True" ForeColor="DarkGreen" HorizontalAlign ="Left"  Font-Italic="False" Font-Names="Verdana" Font-Overline="False"/&gt;
        &lt;EditRowStyle BackColor="#EAEAAE" /&gt;            
    &lt;/asp:GridView&gt; 
</code></pre>

<p>Also, the code for setting the <code>DataSource</code> is as follows:</p>

<pre><code>gridViewReport.DataSource = _reportTable;
gridViewReport.DataBind();
</code></pre>
