Multi-Column format in RadListView

4 posts, 0 answers
  1. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 25 Feb 2010 Link to this post

    Hi,

    In radListView how can I get multi-columns in a row, ie., to get more than one record in a row ?

    At design time can I set the number of columns for the ListView?

    Awaiting ur reply,
    Liji Jose

  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 26 Feb 2010 Link to this post

    Hello Liji,

    You can find the required information in our RadListView-related help topics.
    Custom layouts
    Predefined layouts
    Declarative definition

    Sample code for RadListView with 4 columns:
    <telerik:RadListView runat="server" ID="TelerikListView1" DataSourceID="SqlDataSource1"
                DataKeyNames="CustomerID">
                <LayoutTemplate>
                    <table style="width: 730px; background-color: #D9DFDF;">
                        <tr>
                            <th id="Th1" runat="server">
                                CustomerID
                            </th>
                            <th id="Th2" runat="server">
                                CompanyName
                            </th>
                            <th id="Th3" runat="server">
                                ContactName
                            </th>
                            <th id="Th4" runat="server">
                                ContactTitle
                            </th>
                        </tr>
                        <tr runat="server" id="itemPlaceholder" />
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="Tr2" runat="server" bgcolor="#99ccff">
                        <td>
                            <asp:Label ID="CustomerID" runat="Server" Text='<%#Eval("CustomerID") %>' />
                        </td>
                        <td valign="top">
                            <asp:Label ID="CompanyName" runat="Server" Text='<%#Eval("CompanyName") %>' />
                        </td>
                        <td valign="top">
                            <asp:Label ID="ContactName" runat="Server" Text='<%#Eval("ContactName") %>' />
                        </td>
                        <td valign="top">
                            <asp:Label ID="ContactTitle" runat="Server" Text='<%#Eval("ContactTitle") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
            </telerik:RadListView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT TOP(10) [CustomerID], [CompanyName], [ContactName], [ContactTitle] FROM [Customers]" />

    Kind regards,
    Daniel
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Liji Jose
    Liji Jose avatar
    52 posts
    Member since:
    Jan 2010

    Posted 01 Mar 2010 Link to this post


    Hi Daniel,

    Thanks for your response. ...

    But, what I asked was how to get multiple records in a single row, jus like the sample ListView in your help document.

    Apart from the given style, can I explicitly set the number of records(column-wise) for a row?

    Please reply me...

    -Liji Jose
  5. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 04 Mar 2010 Link to this post

    Hello Liji,

    Although RadListView can successfully mimic RadGrid, it is actually a different control - RadListView is not bound to the "grid" layout, so the term "columns" is a bit relative in this case. 

    As you can see from the sample code in my previous post, the number of columns (in this layout) is equal to the number of cells in the given row.

    However, if you use grouping, the number of your columns will be equal to the GroupItemCount property.
    Basic grouping demo
    Basic grouping help topic

    Please examine the following demos to get familiar with some of the possible layouts:
    RadListView First Look demo
    RadListView Custom paging demo
    RadListView Basic sorting demo
    RadListView Custom sorting demo
    RadListView Predefined layouts
    RadListView Custom layouts

    Best regards,
    Daniel
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
Back to Top