header text and datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would have 2 questions:
1/
Is there any possibility to set up allignment for a column header text (for
example RIGHT)?

2/
I want to use a datagrid style, set up at design time - how could I add a
style for one column to that existing style at runtime? (Without having to ad
styles for all columns).

Thank you.

Lubomir
 
Hi Lubomir
You can set the horixontal align for you column to right
<asp:BoundColumn DataField="DiscId" HeaderText="ID"
HeaderStyle-HorizontalAlign=Right>
<ItemStyle HorizontalAlign="Center" ForeColor="White"
BackColor="Purple"></ItemStyle>
</asp:BoundColumn>

You can also add TemplateColumn and change its style at runtime
<asp:TemplateColumn HeaderText="DVD View">
<ItemStyle BackColor="Purple"></ItemStyle>
<ItemTemplate>
<asp:Button runat="server" Text="Details" CommandName="opencontent"
CausesValidation="false"></asp:Button>
</ItemTemplate>
</asp:TemplateColumn>

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top