New to ListView, need guidance on formatting options

4 posts, 0 answers
  1. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 19 Sep 2015 Link to this post

    I've been spoiled by GridView!

    I have need for something simpler, just basic 2-column lists, no paging, no complex templating, just a list with scrolling as needed.

    The attached graphic shows an approximation of what I need. I manipulated height and width settings and was partially successful in creating an outline, but as you can see, instead of scrollbars I get overflow.

     I am thinking that maybe I need to embed the ListView control inside a panel or other object to force scrollbars, but then presume the headings themselves will also scroll out of view.

     Question 1) is there a better RAD AJAX control?

     Question 2) why to the height and width settings have very little effect on this control, when they are spectacular with GridView? 

     

          <telerik:RadListView ID="RadListView1" runat="server" DataSourceID="publication_date_summary" BorderColor="#3399FF" BorderStyle="Solid" BorderWidth="2px" Height="200px" Skin="Metro" Width="300px"><LayoutTemplate>
            <div class="RadListView RadListView_Metro" style="max-width:140px; max-height:300px;">
                <table cellspacing="0"">
                    <thead>
                        <tr class="rlvHeader">
                            <th style="width:100px;">Decade</th>
                            <th style="width:40px;">Songs</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr id="itemPlaceholder" runat="server">
                        </tr>
                    </tbody>
                </table>
            </div>
    </LayoutTemplate>
            <ItemTemplate>
                <tr class="rlvI">
                    <td>
    <%--                    <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />--%>
                                       <a href='selector.aspx?class_id=5&filter=decade&decade=<%# Eval("pub_date")%>' target="_parent"><%# Eval("pub_date") %></a>
                    </td>
                    <td>
                        <asp:Label ID="CountOfIDLabel" runat="server" Text='<%# Eval("songs") %>' />
                    </td>
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>
                <div class="RadListView RadListView_MetroTouch">
                    <div class="rlvEmpty">
                        There are no items to be displayed.</div>
                </div>
            </EmptyDataTemplate>
     
        </telerik:RadListView>

     

     


     
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 23 Sep 2015 Link to this post

    Hi Tomica,

    You can try achieving this with the following CSS rule
    .RadListView
    {
        overflow: auto;
        height: 200px;
        width: 450px;
    }

    I hope this helps.


    Regards,
    Maria Ilieva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 23 Sep 2015 in reply to Maria Ilieva Link to this post

    Yes, this works just fine. Overflow!

     It's amazing how much I have forgotten now that the UI code handles all the messy details like these.

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 28 Sep 2015 Link to this post

    Hi,

    I'm glad that the provided solution works for you. Do not hesitate to contact us back ion case further assistance is needed.

    Regards,
    Maria Ilieva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top