CyberStore E-Payment 2023 Documentation
CatalogAccessorySelectionGrid Class
Members  Example 


Dovetail.Ecommerce.Controls Namespace : CatalogAccessorySelectionGrid Class

A catalog accessory selection grid control.

Remarks

The CatalogAccessorySelectionGrid control allows the shopper to modify an already accessorized Item in the Shopping Cart. It is not designed to work outside of the ShoppingCartDisplayControl.

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.

In order to designate a template for the Accessory Selection Grid the TemplatePath property can be edited. Similarily the photoLocation can be edited to set the photo location.

The AccessoryMode gets or sets the accessory mode. This was originally intended to allow the control to be in both the shopping cart and the AccessorySelection page.

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 CatalogAccessorySelectionGrid control.

Sub Control Description
CatalogPricingControl Displays the pricing for an Item.
CatalogUnitPriceControl Formerly used to add unit pricing to an Add to Cart control.
CatalogItemImageControl Displays the featured image and Item detail images that have a zoom feature.
Example
See an example of how to configure this control in SitePages.config.
<Control src="CatalogAccessorySelectionGrid.ascx"
      TemplatePath=""
      AccessoryMode="standalone" />
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.

 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CatalogAccessorySelectionGrid.ascx.cs"
    Inherits="Dovetail.Ecommerce.Controls.CatalogAccessorySelectionGrid" %>
<script type="text/javascript">
    function OnGetSelectedFieldValues(selectedValues) {
        if (selectedValues.length == 0) return;
        for (i = 0; i < selectedValues.length; i++) {
            s = "";
            for (j = 0; j < selectedValues[i].length; j++) {
                s = s + selectedValues[i][j] + "&nbsp;";
            }
        }
    }
</script>
<dx:ASPxGridView ID="dxgrdAccessories" ClientInstanceName="dxgrdAccessories" runat="server"
    KeyFieldName="XPItem.Item_ID" OnCommandButtonInitialize="dxgridAccessories_OnCommandButtonInitialize" 
    OnHtmlDataCellPrepared="dxgrdAccessories_OnHtmlDataCellPrepared" OnInit="dxgrdAccessories_OnInit"
    OnSelectionChanged="dxgrdAccessories_SelectionChanged" OnDataBound="dxgrdAccessories_OnDataBound"
    OnCustomUnboundColumnData="dxgridAccessories_CustomUnboundColumnData" SettingsLoadingPanel-Text="Saving Accessories to Cart">
    <Columns>
        <dx:GridViewCommandColumn CellStyle-CssClass="accessories_grid_checkbox" Name="SelectionColumn"
            ShowSelectCheckbox="true" Caption=" ">
        </dx:GridViewCommandColumn>
        <dx:GridViewDataTextColumn FieldName="UserQuantity" Caption="Quantity" ReadOnly="false" Width="70">
            <DataItemTemplate>
                <dx:ASPxTextBox ID="AccessoryQtyBox" runat="server" Width="45" MaxLength="6" OnInit="AccessoryQtyBox_Init"
                    CssClass="qtyFormField" HeaderStyle-HorizontalAlign="Center" Native="true"  CaptionSettings-VerticalAlign="Bottom"/>
            </DataItemTemplate>
            <Settings AllowSort="False" AllowDragDrop="False" />
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn CellStyle-CssClass="accessories_grid_option_name" FieldName="XPItem.Name"
            Caption=" " ReadOnly="true">
            <Settings AllowSort="False" AllowDragDrop="False" />
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="XPItem.StockCode" Caption=" " ReadOnly="true"
            Visible="true">
            <Settings AllowSort="False" AllowDragDrop="False" />
            <DataItemTemplate>
                <dx:ASPxLabel runat="server" ID="StockCodeLabel" CssClass="accessories_grid_option_code"
                    Visible="true" />
                <dx:ASPxComboBox CssClass="option_stk" IncrementalFilteringMode="Contains" ID="ComboDescription" runat="server" Visible="false"
                    OnSelectedIndexChanged="ComboDescription_OnSelectionChanged">
                    <ClientSideEvents SelectedIndexChanged="function(s,e){clbkShoppingCart.PerformCallback('Recalc');}"
                    ButtonClick="function (s, e) { if (e.buttonIndex == 0) s.SetSelectedIndex(-1); }" />
                </dx:ASPxComboBox>
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn CellStyle-CssClass="accessories_grid_required" FieldName="RequiredColumn"
            UnboundType="String">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataColumn Name="UnitPriceControl" FieldName="UnitPriceControl" UnboundType="Object"
            Caption="UnitPriceControl1" ReadOnly="true" Width="100px">
            <Settings AllowSort="False" AllowDragDrop="False" />
            <DataItemTemplate>
                <div class="accessories_grid_price_label">
                    Price:
                </div>
                <div class="accessories_grid__price">
                    <dx:ASPxLabel runat="server" ID="lblAccessoryPrice" />
                </div>
            </DataItemTemplate>
        </dx:GridViewDataColumn>
        <dx:GridViewDataColumn Name="Item_ID" FieldName="XPItem.Item_ID" Caption=" " ReadOnly="true"
            Visible="false">
            <Settings AllowSort="False" AllowDragDrop="False" />
        </dx:GridViewDataColumn>
        <dx:GridViewDataColumn Name="ID" FieldName="ID" Caption=" " ReadOnly="true"
            Visible="false">
            <Settings AllowSort="False" AllowDragDrop="False" />
        </dx:GridViewDataColumn>
        <dx:GridViewDataTextColumn FieldName="AccessoryType" Caption=" " ReadOnly="true"
            Visible="false">
            <Settings AllowSort="False" AllowDragDrop="False" />
        </dx:GridViewDataTextColumn>
    </Columns>
    <Styles AlternatingRow-CssClass="catalog_accessories_grid_alt" Row-CssClass="catalog_accessories_grid"
        Footer-CssClass="accessories_footer" />
    <Settings ShowColumnHeaders="false" />
    <SettingsPager Mode="ShowAllRecords" />
    <SettingsBehavior ProcessSelectionChangedOnServer="true" />
</dx:ASPxGridView>
Inheritance Hierarchy

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

See Also

Reference

CatalogAccessorySelectionGrid Members
Dovetail.Ecommerce.Controls Namespace