CyberStore E-Payment 2023 Documentation
CatalogItemListingByCategoryControl Class
Members  Example 


Dovetail.Ecommerce.Controls Namespace : CatalogItemListingByCategoryControl Class

A catalog Item listing by Category control.

Remarks

The CatalogItemListingByCategoryControl displays a list of Items by Category.

Property Usage

By changing the values of the control's properties in the SitePages.config file for your Site, you can enable or disable certain behaviors, set certain defaults, alter aspects of the display or otherwise cusomtize your site's implementaion of the control.

The following describes properties pertaining to key functional areas of the control that can be configured to suit your needs.

Header Properties

There are a number of properties which dictate the header text of this control. These properties include the DescriptionHeaderText, NameHeaderTextPricingHeaderTextProductLinkHeaderTextQtyinStockHeaderTextStockCodeHeaderText, and UomConversionHeaderText property which sets the description, name, pricing, product link, quantity in stock, stock code, and unit of measure conversion header text respectively.

Display Properties

In order to select the mode you must use the Mode property.

There are multiple properties that dictate what is displayed in this control. The following are displays that have a default value of "false" should you wish for these to be displayed you must change the value to "true".

There are multiple properties that dictate what is displayed in this control. The following are displays that have a default value of "true" should you wish for these to not be displayed you must change the value to "false".

Properties Inherited from the Base CyberStoreBaseControl

Properties specific to the CyberStoreBaseControl can be listed in the following categories:

Override Properties

When the IgnoreControl property is set to true, all processing of a control is skipped, and the control's Visible property is set to false ensuring that it is not rendered in the resulting CyberStore page.

Contextual Properties

Contextual properties define specific details about the current instance of the control based on context. Context can be set by any number of factors including the log in state of the Shopper, the Site being visited, or the properties that have been established for a control.

The AttributesBag property is used internal to control processing and is the collection of attributes, or properties, and their values based on how the control is configured. The attributes in this property are set by processing the SitePages.config file as well as any specific declared property values in any registered sub controls. It allows for the passing down of all properties to a control and any registered sub controls.

The ComConfigUserData and Site_ID properties are read-only values made available to all CyberStore controls to aid in processing and establishing context about the Site and Shopper.

Sub Controls

The table below lists and describes sub controls used by the default CatalogItemListingByCategoryControl.

Sub Control Description
CatalogPricingControl Displays the pricing for an Item.
CatalogItemImageControl Displays the featured image and Item detail images that have a zoom feature.
CatalogOnHandQuantityDisplayControl Displays messages regarding available Item quantity and lead time.
Example
See an example of how to configure this control in SitePages.config.
<Control src="CatalogItemListingByCategoryControl.ascx"
       ShowStockCode="true"
       StockCodeHeaderText="Stock Code"
       ShowName="true"
       NameHeaderText="Name Header Text"
       ShowDescription="true"
       ShowUomConversion="true"
       ShowProductLink="true"
       DescriptionHeaderText="Description Header Text"
       ShowQtyinStock="true"
       QtyinStockHeaderText="Quantity In Stock Header"
       PricingHeaderText="Pricing Header"
       UomConversionHeaderText="UoM Conversion Header"
       ProductLinkHeaderText="Link Header"
       HideQuantityInput="NO_VALUE_SPECIFIED"
       AddtoCartText="Add to Cart"
       ListPriceLabel="List Price:"
       YourPriceLabel="Your Price:"
       PriceLabel="Price Label:"
       LimitedAvailableMessage="&lt;nobr&gt;[QTY] [UOM] In Stock&lt;/nobr&gt;&lt;/br&gt;"
       LimitedUnavaliableMessage="&lt;nobr&gt;Restocking in 2 to 3 days&lt;/nobr&gt;&lt;/br&gt;"
       UnlimitedAvailableMessage="&lt;nobr&gt;[QTY] [UOM] In Stock&lt;/nobr&gt;&lt;/br&gt;"
       UnlimitedUnavailableMessage="&lt;nobr&gt;Ships in 2 weeks&lt;nobr&gt;&lt;/br&gt;"
       LeadTimeMessage="Leadtime: [LEADTIME]&lt;/br&gt;"
       EnableOnHandQuantityDisplay="true"
       EnableLeadTimeMessage="true"
       />
Control Markup

The following is the markup for this control.

Developer's Note:

To create a custom version of the control, copy all of the code below into a file of the same name and place it into your Site's control folder (e.g., ../YourSiteFolder/Control). The CyberStore page engine will then override the default markup with your customized version.

 

<@ Register TagPrefix="uc1" TagName="CatalogSimplePricingControl" Src="~/Control/CatalogSimplePricingControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogItemImageControl" Src="~/Control/CatalogItemImageControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogOnHandQuantityDisplayControl" Src="~/Control/CatalogOnHandQuantityDisplayControl.ascx" >
<@ Control Language="c#" AutoEventWireup="true" CodeBehind="CatalogItemListingByCategoryControl.ascx.cs"
    Inherits="Dovetail.Ecommerce.Controls.CatalogItemListingByCategoryControl" TargetSchema="http>
<%@ Import Namespace="Dovetail.Ecommerce.Base.Module" %>
<asp:Panel runat="server" ID="Results" Visible="true">
    <span class="CatalogListSortLabel" runat="server" id="SortDropdown">Sort By:
        <asp:DropDownList ID="Sort" runat="server" AutoPostBack="true" CssClass="CatalogListSortSelect"
        OnSelectedIndexChanged="Sort_SelectedIndexChanged">
            <asp:ListItem Selected="true" Value="iTEMName">Name</asp:ListItem>
            <asp:ListItem Value="StockCode">Stock Code</asp:ListItem>
            <asp:ListItem Value="UnitPrice">Price</asp:ListItem>
        </asp:DropDownList>
    </span>
    <asp:DataGrid OnItemDataBound="ListingGrid_OnItemDataBound" ID="ListingGrid" runat="server"
        CssClass="CatalogItemListingByCategoryTable" AutoGenerateColumns="false" AllowPaging="true"
        AlternatingItemStyle-CssClass="HighlightTableRow" HeaderStyle-CssClass="HighlightTableRow"
        BorderWidth="0px" ShowFooter="true" ShowHeader="true" PagerStyle-Mode="NumericPages"
        BorderStyle="Solid" ItemStyle-CssClass="ItemByCategoryListingRow">
        <AlternatingItemStyle CssClass="ItemByCategoryListingHighlightRow"></AlternatingItemStyle>
        <HeaderStyle CssClass="ItemListingHeader"></HeaderStyle>
        <Columns>
            <asp:TemplateColumn HeaderText="Stock Code" ItemStyle-CssClass="ItemListingStockCodeCol">
                <ItemTemplate>
                    <%# String.Format("<a class=\"CatalogListNavTrail\" href=\"{0}\">{1}</a>",
                                        Dovetail.Ecommerce.BusinessLogic.Catalog.FriendlyUrl.ItemDetailPage(DataBinder.Eval(Container.DataItem, "StockCode").ToString(), DataBinder.Eval(Container.DataItem, "Name").ToString()),
                                        DataBinder.Eval(Container.DataItem, "StockCode")) %>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="Name" ItemStyle-CssClass="ItemListingNameCol">
                <ItemTemplate>
                    <%# String.Format("<a class=\"CatalogListNavTrail\" href=\"{0}\">{1}</a>",
                                        Dovetail.Ecommerce.BusinessLogic.Catalog.FriendlyUrl.ItemDetailPage(DataBinder.Eval(Container.DataItem, "StockCode").ToString(), DataBinder.Eval(Container.DataItem, "Name").ToString()),
                                        DataBinder.Eval(Container.DataItem, "Name")) %>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="Description" ItemStyle-CssClass="ItemListingDescriptionCol">
                <ItemTemplate>
                    <%# DataBinder.Eval(Container.DataItem, "ShortDescription")%></ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="Qty in Stock" ItemStyle-CssClass="ItemListingQtyinStockCol">
                <ItemTemplate>
                    <uc1:CatalogOnHandQuantityDisplayControl ID="OnHandQuantityDisplay" runat="server"
                        Item_ID='<%# DataBinder.Eval(Container.DataItem, "Item_ID") %>' OnHandDisplayCssClass="OnHandQuantityItemVerticleListings" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="" ItemStyle-CssClass="CatalogItemListingConversionCol">
                <ItemTemplate>
                    <span class="ItemListingConversion">
                        
                    </span>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="" ItemStyle-CssClass="CatalogItemListingSpecificationCol">
                <ItemTemplate>
                    <%# FromatLink(DataBinder.Eval(Container.DataItem, "Link1").ToString()) %>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="Order Qty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Price/Unit"
                ItemStyle-CssClass="ItemListingPricingStockCol">
                <ItemTemplate>
                    <uc1:CatalogSimplePricingControl ID="CatalogaddtocartInput" runat="server" Item_ID='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Item_ID"))%>'
                         AccButtonCss="CatalogAccessoryAddButton"
                        DisplayMode="multiaddinput" />
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
        <PagerStyle NextPageText="Next Page" PrevPageText="Previous Page" CssClass="CatalogListPaginationText">
        </PagerStyle>
    </asp:DataGrid>
    <asp:Label ID="PageNumberDisplay" Visible="true" runat="server">Page <%#(ListingGrid.CurrentPageIndex+1).ToString()  %> of <%#ListingGrid.PageCount.ToString() %></asp:Label>
</asp:Panel>
<asp:Panel runat="server" ID="NoSearchResults" Visible="false">
    <div class="ValidationMessage">
        Sorry, no items were found that matched the criteria you specified in your search.
        For more comprehensive results, please browse our catalog below or try again using
        different keywords in the search panel.<!--//UserMessage--></div>
</asp:Panel>
<asp:Panel runat="server" ID="NoItemsInCategory" Visible="false">
</asp:Panel>
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
      System.Web.UI.TemplateControl
         System.Web.UI.UserControl
            Dovetail.Ecommerce.ControlBases.CyberStoreBaseControl
                  Dovetail.Ecommerce.Controls.CatalogItemVerticleListingControl
                     Dovetail.Ecommerce.Controls.CatalogItemListingByCategoryControl

See Also

Reference

CatalogItemListingByCategoryControl Members
Dovetail.Ecommerce.Controls Namespace