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

RadListView with DataGrouping - how to display data

1 Answer 62 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Gordon
Top achievements
Rank 1
Gordon asked on 08 Jul 2014, 02:43 PM
I'm writing a page which will show a list of artists and a selection of their artworks. In terms of structure it's very much like the demo here: http://demos.telerik.com/aspnet-ajax/listview/examples/datagrouping/defaultcs.aspx

Layout will be:

Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
Artist (name/description/rating)
-- Artwork (title/image/price)
-- Artwork (title/image/price)
-- Artwork (title/image/price)

My SQL query returns all the data on artists and artworks. I can bind this to my RadListView and get the artwork records looking OK by setting them to be the ItemPlaceHolder. But  how can I get all the data for each artist such as Name, Description, Rating etc. I cannot understand how to get ANY data on each outer record except for the value of the DataKeyName. It is not exposed through <%# Eval("ArtistName") %>. 

Here is some code:

<telerik:RadListView ID="SupplierRadListView" runat="server" ItemPlaceholderID="WorkPlaceHolder" OnItemDataBound="SupplierRadListView_ItemDataBound" 
    PageSize="20" AllowPaging="true" DataKeyNames="MemberID">
    <LayoutTemplate>
        <asp:Panel runat="server" ID="ArtistPlaceHolder">

            <asp:Panel runat="server" ID="WorksPlaceHolder">
            </asp:Panel>
        </asp:Panel>
    </LayoutTemplate>
    <DataGroups>
        
        <telerik:ListViewDataGroup GroupField="MemberID" DataGroupPlaceholderID="ArtistPlaceHolder">
            <DataGroupTemplate>
                <div style="float: left; width: 200px;">
                <asp:Literal runat="server" ID="ArtistLiteral" />
                
                </div>
                <asp:Panel runat="server" ID="WorkPlaceHolder" />
            </DataGroupTemplate>
        </telerik:ListViewDataGroup>
    </DataGroups>
    <GroupSeparatorTemplate>
        <hr />
    </GroupSeparatorTemplate>
    <ItemTemplate>
        <div class="work_outer">
            <div class="work_inner">
                <%# Eval("Title") %>
            </div>
        </div>
    </ItemTemplate>
</telerik:RadListView>









1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Jul 2014, 02:36 PM
Hi Gordon,

I am afraid that the requested functionality is not supported out of the box by RadListView control, because ListViewDataGroupItem does not contain this information. Please excuse us for the inconvenience caused.









Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ListView
Asked by
Gordon
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or