HeaderStyle - How to align differently then rest of gird

R

RGB

I am creating a datagrid. I need for the header to align closer to the
bottom of the grid row then then the rest of the data in the grid. I have
tried using HeaderStyle and putting a style of padding-bottom, setting it to
a negative number, but that doesn't seem to have an affect on the look. The
padding for the grid itself is 4px, but I need the header to have NO padding.

Any ideas?

Here is the code (keep in mind it is using style sheets where I am changing
the padding-bottom to no avail!):

<asp:DataGrid Width="100%" id="companyGrid" runat="server"
AutoGenerateColumns="False" CssClass="reporttype highlight" GridLines="None"
style="MARGIN-BOTTOM: 0px">
<AlternatingItemStyle CssClass="greyBkg"></AlternatingItemStyle>
<HeaderStyle CssClass="reporttypeheader"></HeaderStyle>
<Columns>
<cc:RowSelectorColumn HeaderText="COMPANY NAME" SelectionMode="Single">
<ItemStyle Width="40px" CssClass="leftcolumn"></ItemStyle>
</cc:RowSelectorColumn>
<asp:BoundColumn DataField="CompanyName"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="CompanyGUID"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
 
J

John Saunders

RGB said:
I am creating a datagrid. I need for the header to align closer to the
bottom of the grid row then then the rest of the data in the grid. I have
tried using HeaderStyle and putting a style of padding-bottom, setting it
to
a negative number, but that doesn't seem to have an affect on the look.
The
padding for the grid itself is 4px, but I need the header to have NO
padding.

Any ideas?

Here is the code (keep in mind it is using style sheets where I am
changing
the padding-bottom to no avail!):

If you add bottom padding does the alignment get worse? Try adding something
silly like 20px and see what happens.

John Saunders
 
R

RGB

I actually have already done that. First I wanted to make sure it was using
the style that I thought it was, so I made the font ridiculously large. Then
I made the padding ridiculously large as well and the right and left padding
worked, but not the bottom or top. I used "padding:" and set the top, right,
bottom, left. I also used "padding-bottom" and that didn't work either, but
that doesn't work for right or left either.
 
J

John Saunders

RGB said:
I actually have already done that. First I wanted to make sure it was
using
the style that I thought it was, so I made the font ridiculously large.
Then
I made the padding ridiculously large as well and the right and left
padding
worked, but not the bottom or top. I used "padding:" and set the top,
right,
bottom, left. I also used "padding-bottom" and that didn't work either,
but
that doesn't work for right or left either.

I don't know. I'm not an HTML expert. I'd play with margin and with
cellpadding and cellspacing as well. In fact, I'd experiment on this on a
normal <table> until I got it right, then I'd go apply it to the DataGrid.

John Saunders
 
R

RGB

The style works fine outside of the datagrid. I can get the bottom padding
to change for the entire grid, but can't get only the heading to change it's
padding.
 
J

John Saunders

RGB said:
The style works fine outside of the datagrid. I can get the bottom
padding
to change for the entire grid, but can't get only the heading to change
it's
padding.

When you say that it works outside of the grid, do you mean that it works in
a table?

Have you looked at the HTML generated by the DataGrid for a clue? In
particular, can you get the style to work on a table similar to the one that
the DataGrid generates?

John Saunders
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top