Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4538264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:47:18+00:00 2026-05-21T14:47:18+00:00

I have an ASP ListView displaying some items with GroupItemCount set to 3: A

  • 0

I have an ASP ListView displaying some items with GroupItemCount set to 3:

A  D  G
B  E  H
C  F  I

i.e. it groups them vertically in columns. How do I make it display so that it groups horizontally in rows thus?

A  B  C
D  E  F
G  H  I

Here is my ListView code:

<asp:ListView ID="ImagesListView" GroupItemCount="4" runat="server" DataSourceID="EntityDataSource1" GroupPlaceholderID="GroupsGoHere" ItemPlaceholderID="ItemsGoHere" Orientation="Horizontal">
    <LayoutTemplate>
        <div runat="server" id="Main" class="ImagePageMainLayout">
            <div id="ItemsDataPager" runat="server" class="ImagePageHeader">
                <asp:DataPager ID="ImagesDataPager" runat="server" PageSize="16" PagedControlID="ImagesListView">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                    </Fields>
                </asp:DataPager>
            </div>
            <div runat="server" id="GroupsGoHere">
            </div>
        </div>
    </LayoutTemplate>
    <GroupTemplate>
        <div runat="server" id="Images" class="ImagePageGroup">
            <div runat="server" id="ItemsGoHere">
            </div>
        </div>
    </GroupTemplate>
    <ItemTemplate>
        <div id="Item" align="center" runat="server" class="ImagePageItem">
        </div>
    </ItemTemplate>
    <ItemSeparatorTemplate>
        <br />
    </ItemSeparatorTemplate>
</asp:ListView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:47:19+00:00Added an answer on May 21, 2026 at 2:47 pm

    This is caused by the way you use <DIV> in your templates.

    The way you did it, Each group of 3 goes in a <DIV> and each item go below the other inside that div because of your <br /> in the <ItemSeparatorTemplate>.
    Then the next group of 3 goes beside the last group of 3.

    A solution you should try is to remove the <ItemSeparatorTemplate> and modify your <GroupTemplate> to add a <br /> after each group :

    <GroupTemplate>
            <div runat="server" id="Images" class="ImagePageGroup">
                <div runat="server" id="ItemsGoHere">
                </div>
            </div>
            <br />
    </GroupTemplate>
    


    also note that in microsoft’s exemple, they use <table> to format the listview.


    Update:
    I tested your code and your problems is a CSS problem. I got good result by putting width:250px; in the ImagePageGroup class and width:50px; float: left; in the ImagePageItem Class but I don’t know your CSS. With those style, you dont need <br /> at all, that’s why I striped it.

    You may want to test your div layout in plain HTML. Of course, the simplest solution is to switch to a table layout. Table are not evil when you use them to display Tabulated Data, but it’s another matter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.