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">
                        <LayoutTemplate>
                                        <asp:PlaceHolder runat="server" id="ListViewContainer" />
                        </LayoutTemplate>
                        <ItemTemplate>
       ...............
     
    <table  width="170">
      <tr style="height: 30px;">
           <td>
                    <% if (DataBinder.Eval(Container.DataItem , "ScientificResume") != string.Empty)%>
                     <% {%>
                           <a
                                  href='http://kms/Resume/<;;%# Eval("ScientificResume")%>'
                                  target="_blank">Resume</a>
                       <% }
                            else
                              { %>
                               Resume
                        <% } %>
        </td>
     </tr>
                           </tr>
    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.
    Kassaiefarshad@yahoo.com
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 17 May 2012 Link to this post

    Farshad:

    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top