What is Container inside ListView

2 posts, 0 answers
  1. Farshad
    Farshad avatar
    6 posts
    Member since:
    Feb 2012

    Posted 15 May 2012 Link to this post

    Dear Sir/Madam,

    Please response to my email: Kassaiefarshad@yahoo.com

    I have got a RadListView and I have created a Generic List, then I have bound my ListView to Generic List.
    You can see part of RadListView as follow:
    <telerik:RadListView ID="RadListViewKnowledgeOwners" runat="server"
                            ItemPlaceholderID="ListViewContainer" dir="rtl" Width="600px">
                                        <asp:PlaceHolder runat="server" id="ListViewContainer" />
    <table  width="170">
      <tr style="height: 30px;">
                    <% if (DataBinder.Eval(Container.DataItem , "ScientificResume") != string.Empty)%>
                     <% {%>
                                  href='http://kms/Resume/<;;%# Eval("ScientificResume")%>'
                       <% }
                              { %>
                        <% } %>
    As you can see in my code :
                          <% if (DataBinder.Eval(Container.DataItem, "ScientificResume") != string.Empty)%>
    System getting error to me and it doesn't recognize "Container.DataItem". What is "Container.DataItem" in above line of code?

    If this approach is not true please guide me how can I do it inside RadListView?

    Any help appreciated.
    Farshad Kassaie.
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 17 May 2012 Link to this post


    I'd suggest that you reference the ListView/Various data sources  online demo for insights on binding Generic List values in the ItemTemplate of your RadListView.

    I believe the correct syntax would be:
    <%# ((MyBusinessObject) Container.DataItem).ScientificResume != string.Empty  %>

    Hope this helps!

  3. DevCraft R3 2016 release webinar banner
Back to Top