Forum Moderators: open

Message Too Old, No Replies

DataGrid Problem

         

andrewsmd

1:42 pm on Jun 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have this data grid
<ASP:DataGrid id="results" runat="server"
AutoGenerateColumns="False"
AllowPaging="True"
AllowCustomPaging="False"
AllowSorting="True"
PageSize="10"
PagerStyle-Mode="NumericPages"
PagerStyle-HorizontalAlign="Right"
PagerStyle-NextPageText="Next"
PagerStyle-PrevPageText="Prev"
OnPageIndexChanged="results_Page"
GridLines="None"
OnSortCommand="results_Sort" CssClass="Normal">
<PagerStyle Mode="NumericPages" NextPageText="Next" PrevPageText="Prev" HorizontalAlign="Right" />
<AlternatingItemStyle BackColor="#EEEEEE" />
<Columns>
<asp:BoundColumn DataField="Branch" HeaderText="Branch"
SortExpression="Branch asc"><ItemStyle Height = "3em" CssClass="padRight" /></asp:BoundColumn>
<asp:BoundColumn DataField="Title" SortExpression="Title asc" HeaderText="Title"><ItemStyle CssClass="padRight" /></asp:BoundColumn>
<asp:BoundColumn DataField="Category" HeaderText="Category"
SortExpression="Category asc"><ItemStyle Width = "12em" CssClass="padRight"/></asp:BoundColumn>
<asp:BoundColumn DataField="Location" HeaderText="Location"
SortExpression="Location asc"><ItemStyle CssClass="padRight" /></asp:BoundColumn>
<asp:BoundColumn DataField="Salary" HeaderText="Salary"
SortExpression="Salary asc"><ItemStyle CssClass="padRight" /></asp:BoundColumn>

</Columns>
What I would like to do is put a equivalent to padding-right: 2em; on each column. The desired effect is to put some extra space between the columns so they are easier to read. Does anyone know how to do this? Thanks,

marcel

6:28 pm on Jun 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the CSS rule(s) for .padRight?

andrewsmd

7:18 pm on Jun 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I fixed it. Thanks for the reply though.

marcel

7:08 am on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I fixed it.

Could you let us know how you fixed it? there are most likely others that will come across this problem, and it would help them to see a solution here.

thanks.

andrewsmd

1:30 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure I had to put an <asp:BoundColumn DataField="Branch" HeaderText="Branch"
SortExpression="Branch asc" itemstyle-cssclass /> instead of <asp:BoundColumn DataField="Branch" HeaderText="Branch"
SortExpression="Branch asc"><itemstyle cssclass /><asp:BoundColumn>. For some reason it would not use the rules for the css class in padright. Basically moving padright to