This is a migrated thread and some comments may be shown as answers.

Multi-Column format in RadListView

4 Answers 807 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Liji Jose
Top achievements
Rank 1
Liji Jose asked on 25 Feb 2010, 01:44 PM
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

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Feb 2010, 03:48 PM
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.
0
Liji Jose
Top achievements
Rank 1
answered on 01 Mar 2010, 07:04 AM

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
0
Daniel
Telerik team
answered on 04 Mar 2010, 04:28 PM
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.
0
Setiawan
Top achievements
Rank 1
answered on 29 Nov 2019, 09:19 AM

I think the secret is in how you layout the data on the <itemTemplate>.

If you use flexbox, it's gonna display x number of records according to your PageSize.

Tags
ListView
Asked by
Liji Jose
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Liji Jose
Top achievements
Rank 1
Setiawan
Top achievements
Rank 1
Share this question
or