![]() |
HeaderStyle - How to align differently then rest of gird
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> |
Re: HeaderStyle - How to align differently then rest of gird
"RGB" <RGB@discussions.microsoft.com> wrote in message
news:750C09FB-C1FE-4524-A2B0-23AAE17A85B6@microsoft.com... >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 |
Re: HeaderStyle - How to align differently then rest of gird
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. "John Saunders" wrote: > "RGB" <RGB@discussions.microsoft.com> wrote in message > news:750C09FB-C1FE-4524-A2B0-23AAE17A85B6@microsoft.com... > >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 > > > |
Re: HeaderStyle - How to align differently then rest of gird
"RGB" <RGB@discussions.microsoft.com> wrote in message
news:A0D4A988-3949-47BB-89EB-BCFB702CE9E8@microsoft.com... >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 |
Re: HeaderStyle - How to align differently then rest of gird
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. "John Saunders" wrote: > "RGB" <RGB@discussions.microsoft.com> wrote in message > news:A0D4A988-3949-47BB-89EB-BCFB702CE9E8@microsoft.com... > >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 > > > |
Re: HeaderStyle - How to align differently then rest of gird
"RGB" <RGB@discussions.microsoft.com> wrote in message
news:C11B5E19-F17F-4EB2-9852-DFAEBA5747A7@microsoft.com... > 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 |
| All times are GMT. The time now is 09:01 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.