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

Why is my Listview not populated

1 Answer 49 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Tonyz289
Top achievements
Rank 1
Tonyz289 asked on 14 Mar 2012, 09:53 PM
I have two Listview's. They are populated the same was. One does not give any evidence of getting any data. HELP!

Here is the definition of the one that has no data:
<telerik:RadListView ID="RadListView2" runat="server" AllowPaging="True" ItemPlaceholderID="ListPlaceHolder"
    Skin="listview_2" EnableEmbeddedSkins="false" DataKeyNames="id,filenameextension,typeAbbr,title"
    OnNeedDataSource="RadListView2_NeedDataSource">
    <LayoutTemplate>
        <table id="products" class="products">
            <thead>
                <tr>
                    <th>
                        Prev
                    </th>
                    <th class="expand">
                    </th>
                    <th>
                        File Name
                    </th>
                    <th>
                        Asset Type
                    </th>
                    <th>
                        Document Type
                    </th>
                    <th>
                        Advertiser Name
                    </th>
                    <th>
                        Advertiser Category
                    </th>
                    <th>
                        Details
                    </th>
                    <th>
                        Market
                    </th>
                    <th>
                        Product Category
                    </th>
                    <th>
                        Keywords
                    </th>
                    <th>
                        Approved
                    </th>
                    <th>
                        Date
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr id="ListPlaceHolder" runat="server">
                </tr>
            </tbody>
        </table>
    </LayoutTemplate>
    <ItemTemplate>
        <tr>
            <td>
                <%# String.Format("javascript:Popup_Window('asset_preview', '{0}');", Eval("id").ToString())%>
            </td>
            <td>
                <asp:CheckBox ID="ChkImage2" runat="server" Style="float: left; padding-top: 5px" />
            </td>
            <td>
                <%# String.Format("javascript:Popup_Window('asset_detail', '{0}');", Eval("id").ToString())%>
            </td>
            <td>
                <%# Eval("typeAbbr")%>
            </td>
            <td>
                <%# Eval("documentTypeText")%>
            </td>
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        No Assets Found 2
    </EmptyDataTemplate>
</telerik:RadListView>

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 19 Mar 2012, 11:35 AM
Hello,

I think that the problem is in the databinding you are using. Could you share your RadListView_NeedDataSource event?

Additionally, I am attaching the project I used to test your case. Give the project a try and check whether there are differences with your project.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ListView
Asked by
Tonyz289
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or