Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The RadListView control does not have an item placeholder specified

the code :

<telerik:RadListView ID="RadListView1" Width="100%" AllowPaging="True" runat="server"
            Skin="Metro" allowsorting="true" ItemPlaceholderID="ProductsHolder" DataKeyNames="Product_ID" GroupPlaceholderID="CategoryHolder"
           GroupItemCount="4" >
            <GroupTemplate>
              <fieldset style="float: left; width: 330px; margin-right: 15px;">
                    <legend><%#Eval("CATEGORY_NAME") %></legend>
                    <table>
                        <tr>
                            <td>
                               <asp:Panel ID="CategoryHolder" runat="server"></asp:Panel>

                            </td>
                        </tr>
                    </table>
                </fieldset>


            </GroupTemplate>

            <LayoutTemplate>
                <fieldset style="width: 100%; margin: 0 auto; border: none;" id="FieldSet1">
                    <telerik:RadDataPager ID="RadDataPager2" runat="server" PagedControlID="RadListView1"
                        Visible='<%# Container.PageCount != 1%>' Skin="Metro" PageSize="52">
                        <Fields>
                            <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="First" PrevButtonText="Prev"
                                HorizontalPosition="LeftFloat" />
                            <telerik:RadDataPagerButtonField FieldType="Numeric" />
                            <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Next" LastButtonText="Last"
                                HorizontalPosition="RightFloat" />
                        </Fields>
                    </telerik:RadDataPager>
                    <br />
                    <asp:Panel ID="ProductsHolder" runat="server">
                    </asp:Panel>
                    <table cellpadding="0" cellspacing="4" width="100%;" style="clear: both;">
                        <tr>
                            <td>
                                <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
                                    Visible='<%# Container.PageCount != 1%>' Skin="Metro" PageSize="52">
                                    <Fields>
                                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="First" PrevButtonText="Prev"
                                            HorizontalPosition="LeftFloat" />
                                        <telerik:RadDataPagerButtonField FieldType="Numeric" HorizontalPosition="NoFloat" />
                                        <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Next" LastButtonText="Last"
                                            HorizontalPosition="RightFloat" />
                                    </Fields>
                                </telerik:RadDataPager>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </LayoutTemplate>
            <EmptyDataTemplate>
                <div style="width: 100%; text-align: center;">
                    <b>No Results Found</b></div>
            </EmptyDataTemplate>
            <ItemTemplate>
                <div style="float: left; padding-bottom: 20px; padding-left: 10px; padding-right: 10px;">
                    <div class="CardItem" style="margin: auto !important;">
                        <div class="cardDisplay">
                            <img src="../App_Themes/VivaTheme/images/loading_big.gif" alt="" onerror="javascript:this.onerror = null;this.src='../images/Orders/VivaNotAvailable.jpg';"
                                onload="RetrievePicture(this,'<%# Eval("PRODUCT_ID")%>');" class="lof-image"
                                width="180" height="117" style="margin-bottom: 5px;" />
                        </div>
                        <div class="points">
                            <%# DataBinder.Eval(Container.DataItem, "SALES_PRICE", "{0:###,###,###,##0.00}") + " " + Eval("CURRENCY_ABREVIATION")%>
                        </div>
                        <hr class="fleft" style="border: 1px solid #D9E1E3; width: 195px;" />
                        <div class="CardItemDesc">
                            <table width="100%" style="display: inline-block;">
                                <tr>
                                    <td>
                                        <%# Eval("PRODUCT_NAME")%>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <telerik:RadRating ID="RadRating1" Skin="Metro" runat="server" Enabled="false" Value='<%# Double.Parse(Eval("SALES_PRICE").ToString()) % 3 +2 %>'>
                                        </telerik:RadRating>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <img src="../images/Orders/AddToCart.png" alt="Add to Cart" height="23" onclick="AddToCart(this, '<%# Eval("PRODUCT_NAME")%>', '<%# Eval("SALES_PRICE") %>', '<%# Eval("CURRENCY_ABREVIATION") %>', '<%# (Eval("UNIT_SYMBOL").ToString()=="K" ? "Kg" : (Eval("UNIT_SYMBOL").ToString() == "U" ? "Pc" : Eval("UNIT_SYMBOL"))) %>', '<%# Eval("PRODUCT_ID") %>', '<%# Telepaty.SecurityHelper.StringEncryptorDecryptor.Instance.EncryptString(Eval("PRODUCT_ID").ToString()) %>');return false;"
                                            class="Clickable fleft" />
                                        <% if (LoggedClient.Current != null)
                                           { %>
                                        <img src="../images/Orders/BuyNow.png" alt="Buy Now" style="padding-left: 30px;"
                                            height="23" onclick="javascript:window.location='Checkout.aspx?pID=<%# Telepaty.SecurityHelper.StringEncryptorDecryptor.Instance.EncryptString(Eval("PRODUCT_ID").ToString()) %>';return false;"
                                            class="Clickable fright" />
                                        <% }
                                           else
                                           { %>
                                        <img src="../images/Orders/BuyNow.png" alt="Buy Now" style="padding-left: 30px;"
                                            height="23" onclick="javascript:window.location='/Login.aspx?ref=anonym&pID=<%# Telepaty.SecurityHelper.StringEncryptorDecryptor.Instance.EncryptString(Eval("PRODUCT_ID").ToString()) %>';return false;"
                                            class="Clickable fright" />
                                        <% }; %>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </ItemTemplate>
        </telerik:RadListView>

server side :

protected void Page_Load(object sender, EventArgs e)
{
       if (!IsPostBack)
    {
        RadListView1.DataSource = OrderDataHelper.GetProductByCategoryforGrouping();
        RadListView1.DataBind();
    }
}

The RadListView control does not have an item placeholder specified anyone know why this problem occured ?

like image 653
Sora Avatar asked Jul 17 '13 09:07

Sora


2 Answers

You set ItemPlaceholderID="ProductsHolder" in your ListView but there is no PlaceHolder with given ID in your LayoutTemplate .

Just add this code to your LayoutTemplate

   <LayoutTemplate>
      <asp:PlaceHolder ID="ProductsHolder" runat="server"></asp:PlaceHolder>
   </LayoutTemplate>
like image 137
zey Avatar answered Sep 28 '22 01:09

zey


The error you are getting does means that you should declare a control in your LayoutTemplate which to determine where the items (ItemTemplate, EditItemTemplate etc.) should be instantiated.

Please refer to this live demo for a sample of how to construct RadListView programmatically.

like image 20
Arun Bertil Avatar answered Sep 28 '22 01:09

Arun Bertil