• 0

Fill query results in two columns


Question

I will preface this by saying I'm not entirely sure if this should be here or the programming section, and that the server I'm using really sucks and unfortunately nothing can be changed about it, so that's why I'm using crappy things like an Access DB instead of a MySQL or MSSQL database.

I am encountering a bit of difficulty trying to get query results displayed how I would like. I have a list of 1000+ people in an Access database and am running a query to get back all of the results. I just fill them into a gridview and have them paged by every 100 people.

What I'd like to do, however, is make the results display in two columns side-by-side with each having 50 records, and I guess I have no idea how to do that. Right now I have the code below which pages the results and is all great and grand, but if I could somehow get it to show up in 2 columns that'd be awesome...


<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="alumni.mdb" SelectCommand="SELECT * FROM [Alumni] ORDER BY 1">
</asp:AccessDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
Width = "250" CellPadding="1" DataKeyNames="HP#" DataSourceID="AccessDataSource1"
ForeColor="#490052" GridLines="None" AllowSorting="True" AllowPaging="True" PageSize=100>
<RowStyle BackColor="#D1C38F" />
<Columns>
<asp:boundfield DataField="HP#" HeaderText="HP#" ReadOnly="True" InsertVisible="False" SortExpression="HP#">
</asp:boundfield>
<asp:boundfield DataField="Name" HeaderText="Name" SortExpression="Name">
</asp:boundfield>

</Columns>
<FooterStyle BackColor="#490052" Font-Bold="True" ForeColor="#C5B377" />
<PagerStyle BackColor="#D1C38F" ForeColor="#490052" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1C38F" Font-Bold="True" ForeColor="#490052" />
<HeaderStyle BackColor="#490052" Font-Bold="True" ForeColor="#C5B377" />
<EditRowStyle BackColor="#D1C38F" />
<AlternatingRowStyle BackColor="#DCD3AA" />
</asp:GridView>
[/CODE]

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.