I am trying to set the background color on the thumbnail area. Its BLACK, i tried css but it didn't work.
I also get an error once lightbox is loaded from the thumbnail click event.
Say i have 6 images in the thumbnail and i click any thumbnail to open LightBox. It pops up with the correct image and showing say "Image 4 of 6" then i click one of the buttons to navigate and i get an ".../store/fake" - file does not exist. We dont have a fake directory, all files are loaded with advanced databinding. So confused why its looking for a file.
Also when i click again in the gallery after closing the lightbox, it seems its still loaded in memory. The image 4 is still showing from last click then it suddenly switches to say "2" which i just clicked to reopen the light box. Do i have to destroy lightbox after its closed?
                                .RadImageGallery .rigThumbnailsList {    background-color: white;}I also get an error once lightbox is loaded from the thumbnail click event.
Say i have 6 images in the thumbnail and i click any thumbnail to open LightBox. It pops up with the correct image and showing say "Image 4 of 6" then i click one of the buttons to navigate and i get an ".../store/fake" - file does not exist. We dont have a fake directory, all files are loaded with advanced databinding. So confused why its looking for a file.
Also when i click again in the gallery after closing the lightbox, it seems its still loaded in memory. The image 4 is still showing from last click then it suddenly switches to say "2" which i just clicked to reopen the light box. Do i have to destroy lightbox after its closed?
9 Answers, 1 is accepted
0
                                Hello,
Regarding the thumbnails area background color, you should be able to change it by modifying the CSS as demonstrated below.
CSS:
As for the lightbox issues I have to say that the described behavior is not expected. In order for us to investigate what is causing them I would like to ask you to share with us the markup and code-behind of the page.
Additionally please try-out the following on your end.
Regards,
Angel Petrov
Telerik 
 
                                        Regarding the thumbnails area background color, you should be able to change it by modifying the CSS as demonstrated below.
CSS:
.RadImageGallery ul.rigThumbnailsList  {    background-color: white;}As for the lightbox issues I have to say that the described behavior is not expected. In order for us to investigate what is causing them I would like to ask you to share with us the markup and code-behind of the page.
Additionally please try-out the following on your end.
- Upgrade to the latest version(if you are using an older one) and test the application again.
- Verify that a JavaScript error is not thrown that might be breaking the functionality.
Regards,
Angel Petrov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
                                
                                                    SDI
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 18 Mar 2015, 12:24 PM
                                            
                                        Right its a list, so putting in the "ul" for the css worked. Thanks!
I am adding a RadImageGallery in code-behind to a placeholder.
 
 
 
It shows correctly and displays the Thumbnail images. Clicking on an thumbnail image brings up the LightBox correctly, but doesnt show AJAX. Its actually empty for a while then the image suddenly appears. If i navigate the light box it correctly show AJAX and goes through the image list, but pops up the describe message box about '\fake\" file doesnt exist. This is in the environment, its not released online yet. If i close the lightbox and reopen by clicking on another thumbnail that was NOT the last one it left off with it opens back up lightbox with the previous selected image showing, then after a few seconds, it switches to the one that was just selected, again no AJAX either until right before it switches. If another product in this RadListView has only 1 thumbnail it shows AJAX correctly when it loads, but the '\fake\' message box appears again.
Now this is a store, so on the page their is a set number of items in a RadListView with the layout in a Template. This works fine they all show as the use has designed the layout to be.
 
 
Error message box
Is the RadImageGallery being dynamically loaded a problem? Is there something else i need to setup for the LightBox?
                                        I am adding a RadImageGallery in code-behind to a placeholder.
myRadImageGallery.DisplayAreaMode = ImageGalleryDisplayAreaMode.LightBoxmyRadImageGallery.ThumbnailsAreaSettings.ThumbnailsSpacing = New WebControls.Unit(3)myRadImageGallery.ThumbnailsAreaSettings.Height = New WebControls.Unit(Convert.ToDouble(35))myRadImageGallery.ThumbnailsAreaSettings.ShowScrollbar = FalsemyRadImageGallery.ThumbnailsAreaSettings.ShowScrollButtons = FalsemyRadImageGallery.ThumbnailsAreaSettings.Mode = ImageGalleryThumbnailsAreaMode.ThumbnailsmyRadImageGallery.ThumbnailsAreaSettings.EnableZoneScroll = True' set the h/w of each thumbnailmyRadImageGallery.ThumbnailsAreaSettings.ThumbnailHeight = New WebControls.Unit(28)myRadImageGallery.ThumbnailsAreaSettings.ThumbnailWidth = New WebControls.Unit(28)myRadImageGallery.DataSource = Me.GetGalleryImages(StoreItemId, cMyManager)myRadImageGallery.DataThumbnailField = "ImageThumbnail"myRadImageGallery.DataImageField = "Image"myRadImageGallery.DataBind()myHtmlGenericControl.Controls.Add(myRadImageGallery)' add to the placeholderMyPlaceHolder.Controls.Add(myHtmlGenericControl)It shows correctly and displays the Thumbnail images. Clicking on an thumbnail image brings up the LightBox correctly, but doesnt show AJAX. Its actually empty for a while then the image suddenly appears. If i navigate the light box it correctly show AJAX and goes through the image list, but pops up the describe message box about '\fake\" file doesnt exist. This is in the environment, its not released online yet. If i close the lightbox and reopen by clicking on another thumbnail that was NOT the last one it left off with it opens back up lightbox with the previous selected image showing, then after a few seconds, it switches to the one that was just selected, again no AJAX either until right before it switches. If another product in this RadListView has only 1 thumbnail it shows AJAX correctly when it loads, but the '\fake\' message box appears again.
Now this is a store, so on the page their is a set number of items in a RadListView with the layout in a Template. This works fine they all show as the use has designed the layout to be.
<div id="divItemTemplate" runat="server" style="float: left; margin-right: 15px;">    <%--main item block - width and height determined by the application--%>    <asp:Panel runat="server" ID="PanelItem" Height='<%#ItemHeight%>' Width='<%#ItemWidth%>'>        <fieldset style="float: left; width: 100%; margin-top: 10px; height: 100%; float: left;" class="ui-widget ui-widget-content ui-corner-all">            <legend id="Legend1" style="text-align: center;" class="ui-widget-header ui-corner-all">  <b><%#Eval("Name")%></b>  </legend>            <%--main wrapper for the item in the fieldset--%>            <div style="float: left; width: 100%;">                <div style="float: left; width: 100%; margin: 5px;">                    <asp:PlaceHolder runat="server" ID="PlaceHolderTop" />                </div>                <div style="float: left; width: 100%;">                    <div runat="server" id="divLeft" style="float: left;">                        <asp:PlaceHolder runat="server" ID="PlaceHolderLeft" />                    </div>                    <div runat="server" id="divCenter" style="float: left; margin-left: 5px;">                        <asp:PlaceHolder runat="server" ID="PlaceHolderCenter" />                    </div>                    <div runat="server" id="divRight" style="float: left; margin-left: 5px;">                        <asp:PlaceHolder runat="server" ID="PlaceHolderRight" />                    </div>                </div>                <div style="float: left; width: 100%; margin: 5px;">                    <asp:PlaceHolder runat="server" ID="PlaceHolderBottom" />                </div>            </div>        </fieldset>    </asp:Panel></div>Protected ReadOnly Property ItemWidth() As Unit     Get         Return DirectCast(ViewState("ItemWidth"), Unit)     End Get End Property Protected ReadOnly Property ItemHeight() As Unit     Get         Return DirectCast(ViewState("ItemHeight"), Unit)     End Get End Property Protected ReadOnly Property HeightPage() As Unit     Get         Return DirectCast(ViewState("HeightPage"), Unit)     End Get End PropertyError message box
Is the RadImageGallery being dynamically loaded a problem? Is there something else i need to setup for the LightBox?
0
                                
                                                    SDI
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 20 Mar 2015, 04:04 PM
                                            
                                        Telerik, you see anything here? You must have something in the control for it to be looking in "...\fake" for some reason. Again we are doing databinding via SQL Server, not a folder. So not even sure why the LightBox from the Gallery is even looking for a folder or file.
thanks!
                                        thanks!
0
                                Hi,
Indeed the problem may be relate to the dynamic creation of the control. Could you please let us know at what stage of the page life-cycle is the control added? Additionally please try modifying the binding so that the control gets populated inside the NeedDataSource handler(as demonstrated here).
Have in mind that it would be hard to tell what exactly causes this problem without replicating it locally. Considering the aforementioned I would kindly like to ask you to provide us with a small sample which we can debug.
Regards,
Angel Petrov
Telerik 
 
                                        Indeed the problem may be relate to the dynamic creation of the control. Could you please let us know at what stage of the page life-cycle is the control added? Additionally please try modifying the binding so that the control gets populated inside the NeedDataSource handler(as demonstrated here).
Have in mind that it would be hard to tell what exactly causes this problem without replicating it locally. Considering the aforementioned I would kindly like to ask you to provide us with a small sample which we can debug.
Regards,
Angel Petrov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
                                
                                                    SDI
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 23 Mar 2015, 02:14 PM
                                            
                                        I took the page code out and its mark-up and put it into a zip. You can see the AddControl (line 435) function gets called in the in the ItemCreated event. It then creates the control and places it in a PlaceHolder - "Case cMyManager.ProductLayoutItems.Image" (line 565). When its created it does indeed get a DataSource added to the Gallery. I tried adding a handler too it as well and it still showed the "fake" message.
Let me know if there is a setting to make it stop looking for a file.
I thought i could upload a zip but i cant. Ithought u used to be able to. So used the format.
aspx
vb
Thanks
                                        Let me know if there is a setting to make it stop looking for a file.
I thought i could upload a zip but i cant. Ithought u used to be able to. So used the format.
aspx
001.<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>002. 003.<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">004. 005.    <style type="text/css">006.        .DivOuter007.        {008.            width: 100%;009.            text-align: center;010.        }011.         012.        .DivCenter013.        {014.            display: inline-block;015.        }016.         017.        .rbText018.        {019.            font-size: larger;020.        }021.        .detailsTop022.        {023.            width: 100%;024.            height: 150px;            025.        }026.        .detailsTop ul027.        {028.            list-style-image: none;029.            list-style-type: none;030.            margin: 0;031.            padding: 10px;032.        }033.        .detailsTop ul label034.        {035.            font-weight: bold;            036.        }037.        .detailsBottom038.        {039.            width: 100%;        040.            height: 35%;                041.        }042.        .detailsBottom ul043.        {044.            list-style-image: none;045.            list-style-type: none;046.            margin: 0;047.            padding: 10px;048.        }049.        .detailsBottom ul label050.        {051.            font-weight: bold;            052.        }053.       .detailsButton054.        {055.            width: 100%;        056.            height: 225px;                057.        }        058.        .image-container059.        {060.            padding: 10px;061.            width: 120px;062.            float: left;063.            vertical-align:middle;   064.            text-align:center;         065.        }066.        .data-container067.        {   068.            width: auto;            069.        }070.        .numericPageSize {071.            vertical-align: middle;072.            line-height: 22px;073.            display: inline-block;074.        }075. 076. 077.    </style>078. 079.    <%--RadImageGallery--%>080.    <style type="text/css">081.        .RadImageGallery .rigThumbnailsList li img {082.            opacity: 1;            083.        }084. 085.        .RadImageGallery ul.rigThumbnailsList  {086.            background-color: white;087.        }088.    </style>089. 090.    <%-- Lightbox for poping up images (viewer)  --%>091.    <script src="../scripts/lightbox.js" type="text/javascript"></script>    092.    <link href="../styles/lightbox.css" rel="stylesheet" />093.     094.</asp:Content>095. 096.<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">097. 098.    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">099.        <AjaxSettings>100.            <telerik:AjaxSetting AjaxControlID="RadDataPager3">101.                <UpdatedControls>102.                    <telerik:AjaxUpdatedControl ControlID="Panel1"  />                    103.                </UpdatedControls>104.            </telerik:AjaxSetting>105.            <telerik:AjaxSetting AjaxControlID="RadDataPager4">106.                <UpdatedControls>107.                    <telerik:AjaxUpdatedControl ControlID="Panel1"  />                    108.                </UpdatedControls>109.            </telerik:AjaxSetting>            110.            <telerik:AjaxSetting AjaxControlID="RadListViewStoreItems">111.                <UpdatedControls>112.                    <telerik:AjaxUpdatedControl ControlID="Panel1"  />                    113.                </UpdatedControls>114.            </telerik:AjaxSetting>115.          116.        </AjaxSettings>117.        <ClientEvents OnResponseEnd="OnResponseEnd" OnRequestStart="OnRequestStart"/>118.    </telerik:RadAjaxManager>119. 120.    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" ToolTip="Please wait..." Height="50px" Width="50px"/>    121.    <telerik:RadWindowManager runat="server" ID="RadWindowManager1" EnableShadow="true"  />         122. 123.    <%-- store items --%>124.    <fieldset id="FieldSet1" style="width: 100%; height: 100%;" class="ui-widget ui-widget-content ui-corner-all">125.        <legend id="Legend1" class="ui-widget-header ui-corner-all">  Your Store  </legend>126. 127.        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"128.            ClientEvents-OnRequestStart="OnRequestStart" ClientEvents-OnResponseEnd="OnResponseEnd">129. 130.        <asp:Panel runat="server" ID="Panel1" Width="970px" Height='<%#HeightPage%>'>131.                         132.            <div style="float: left; width: 100%; margin: 10px;">133.                <telerik:RadDataPager ID="RadDataPager3" runat="server" PagedControlID="RadListViewStoreItems" Width="95%">134.                    <Fields>135.                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" />136.                        <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="6" />137.                        <telerik:RadDataPagerButtonField FieldType="NextLast" />138.                        <telerik:RadDataPagerPageSizeField PageSizeComboWidth="60" PageSizeText="Page size: " />139.                        <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="25" />140.                    </Fields>141.                </telerik:RadDataPager>142.            </div>143. 144.            <div style="float: left; width: 100%; " >145. 146.                <telerik:RadListView runat="server" ID="RadListViewStoreItems" ItemPlaceholderID="StorePlaceHolder" DataKeyNames="StoreItemId, StoreItemGroupId">147.                    <LayoutTemplate>148.                        <fieldset>149.                            <div style="float: left; width: 100%; padding: 5px;">150.                                <asp:PlaceHolder ID="StorePlaceHolder" runat="server" />151.                            </div>152.                        </fieldset>153.                    </LayoutTemplate>154. 155.                    <ItemTemplate>156. 157.                        <%--  hidden id fields --%>158.                        <div style="display: none;">159.                            <telerik:RadTextBox runat="server" ID="RadTextBoxStoreItemId" Text='<%# Eval("StoreItemId") %>' />160.                            <telerik:RadTextBox runat="server" ID="RadTextBoxApplicationId" Text='<%# Eval("ApplicationId") %>' />161.                            <telerik:RadTextBox runat="server" ID="RadTextBoxName" Text='<%# Eval("Name") %>' />162.                            <telerik:RadTextBox runat="server" ID="RadTextBoxDescription" Text='<%# Eval("Description") %>' />163.                            <telerik:RadTextBox runat="server" ID="RadTextBoxUseStockLevel" Text='<%# Eval("UseStockLevel")%>' />164.                            <telerik:RadTextBox runat="server" ID="RadTextBoxStockLevel" Text='<%# Eval("StockLevel")%>' />165.                            <telerik:RadTextBox runat="server" ID="RadTextBoxSKU" Text='<%# Eval("SKU") %>' />166.                            <telerik:RadTextBox runat="server" ID="RadTextBoxOptions" Text='<%# Eval("Color")%>' />167.                            <telerik:RadTextBox runat="server" ID="RadTextBoxListPrice" Text='<%# Eval("ListPrice") %>' />168.                            <telerik:RadTextBox runat="server" ID="RadTextBoxDiscountedPrice" Text='<%# Eval("DiscountedPrice")%>' />169.                            <telerik:RadTextBox runat="server" ID="RadTextBoxDiscountedPct" Text='<%# Eval("DiscountedPct")%>' />170.                            <telerik:RadTextBox runat="server" ID="RadTextBoxDiscountStartDate" Text='<%# Eval("DiscountStartDate")%>' />171.                            <telerik:RadTextBox runat="server" ID="RadTextBoxDiscountEndDate" Text='<%# Eval("DiscountEndDate")%>' />172.                            <telerik:RadButton runat="server" ID="RadButtonUseDiscount" Checked='<%# Eval("UseDiscount")%>' />173.                            <telerik:RadTextBox runat="server" ID="RadTextBoxOnlinePrice" Text='<%# Eval("OnlinePrice") %>' />174.                            <telerik:RadTextBox runat="server" ID="RadTextBoxCost" Text='<%# Eval("Cost") %>' />175.                            <telerik:RadTextBox runat="server" ID="RadTextBoxWeight" Text='<%# Eval("Weight") %>' />176.                        </div>177. 178.                        <div id="divItemTemplate" runat="server" style="float: left; background-color:rebeccapurple">179.                            <%--main item block - width and height determined by the application--%>180.                            <fieldset id="FieldSetItem" runat="server" style="float: left; margin-top: 10px; width: 97%; height:350px;" class="ui-widget ui-widget-content ui-corner-all">181.                                <legend id="Legend1" style="text-align: center;" class="ui-widget-header ui-corner-all">  <b><%#Eval("Name")%></b>  </legend>182.                                <%--main wrapper for the item in the fieldset--%>183.                                <div style="float: left; width: 100%;">184.                                    <div style="float: left; width: 100%; margin-top: 5px; margin-bottom: 5px; background-color: lightgreen;">185.                                        <%--<asp:Label ID="Label4" runat="server" Text="TOP" />--%>186.                                        <asp:PlaceHolder runat="server" ID="PlaceHolderTop" />187.                                    </div>188.                                    <div style="float: left; width: 100%;">189.                                        <div runat="server" id="divLeft" style="float: left; margin-right: 5px; background-color: fuchsia;">190.                                            <%--<asp:Label runat="server" Text="LEFT" />--%>191.                                            <asp:PlaceHolder runat="server" ID="PlaceHolderLeft" />192.                                        </div>193.                                        <div runat="server" id="divCenter" style="float: left; margin-right: 5px; background-color: coral;">194.                                            <%--<asp:Label ID="Label1" runat="server" Text="CENTER" />--%>195.                                            <asp:PlaceHolder runat="server" ID="PlaceHolderCenter" />196.                                        </div>197.                                        <div runat="server" id="divRight" style="float: left; background-color: darkgray;">198.                                            <%--<asp:Label ID="Label2" runat="server" Text="RIGHT" />--%>199.                                            <asp:PlaceHolder runat="server" ID="PlaceHolderRight" />200.                                        </div>201.                                    </div>202.                                    <div style="float: left; width: 100%; margin-top: 5px; margin-bottom: 5px; background-color: lightgreen;">203.                                        <%--<asp:Label ID="Label3" runat="server" Text="BOTTOM" />--%>204.                                        <asp:PlaceHolder runat="server" ID="PlaceHolderBottom" />205.                                    </div>206.                                </div>207.                            </fieldset>                            208.                        </div>209. 210.                    </ItemTemplate>211.                </telerik:RadListView>212. 213.            </div>214. 215.            <div style="float: left; width: 100%; margin: 10px;">216.                <telerik:RadDataPager ID="RadDataPager4" runat="server" PagedControlID="RadListViewStoreItems" Width="95%">217.                    <Fields>218.                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" />219.                        <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="6" />220.                        <telerik:RadDataPagerButtonField FieldType="NextLast" />221.                        <telerik:RadDataPagerPageSizeField PageSizeComboWidth="60" PageSizeText="Page size: " />222.                        <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="25" />223.                    </Fields>224.                </telerik:RadDataPager>225.            </div>226. 227.        </asp:Panel>228. 229.        </telerik:RadAjaxPanel>230.    </fieldset>231. 232.    <telerik:RadLightBox ID="RadLightBox1" runat="server" Modal="true" LoopItems="true" ZIndex="100000">233.        <ClientSettings AllowKeyboardNavigation="true" NavigationMode="Zone">234.            <AnimationSettings HideAnimation="Fade" NextAnimation="Fade" PrevAnimation="Fade" ShowAnimation="Fade" />235.        </ClientSettings>236.    </telerik:RadLightBox>237. 238.    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">239.        <script type="text/javascript">240. 241.            function OpenRadLigthBox(index) {242.                var lightBox = $find('<%= RadLightBox1.ClientID %>');243.                lightBox.set_currentItemIndex(index);244.                lightBox.show();245.            }246. 247.            function OnResponseEnd(sender, eventArgs) {248.                //alert('Response END initiated by: ' + eventArgs.get_eventTarget());249.                document.body.style.cursor = "default";250.                // function in MasterPage                251.                ContinueSession;252.            }253. 254.            function OnRequestStart(sender, eventArgs) {255.                //alert('Response START initiated by: ' + eventArgs.get_eventTarget());256.                document.body.style.cursor = "wait";257.            }258. 259.        </script>260.    </telerik:RadScriptBlock>261. 262.</asp:Content>vb
0001.Imports System.Data0002.Imports Telerik.Web.UI0003.Imports System.IO0004. 0005. 0006.Partial Class Default20007.    Inherits System.Web.UI.Page0008. 0009. 0010.#Region " Declarations "0011. 0012.    Const ImageInfo As String = "../images/common/info-24.png"0013.    Const ImageMajorrError As String = "../images/problem-major-32.png"0014.    Const ImageMinorError As String = "../images/problem-minor-32.png"0015.    Const ImageEmailSent As String = "../images/email-24.png"0016. 0017.#End Region0018. 0019.#Region " Data Properties "0020. 0021.    ''' <summary>0022.    ''' Get the MyRSI_StoreItems_tbl datatable.0023.    ''' </summary>0024.    ''' <remarks></remarks>0025.    Private ReadOnly Property GetStoreItemsWithGrpsDT() As DataTable0026.        Get0027. 0028.            Dim StoreItemsDT As DataTable = Nothing0029. 0030.            ' make sure we are disposing0031.            Using myManager As New cMyManager()0032.                ' make sure we are disposing0033.                Using MyRSI_StoreItems_tbl As New cMyManager.RSI_StoreItems_tbl(myManager)0034.                    Using MyRSI_cMyHelper As New cMyManager.cMyHelper()0035.                        With MyRSI_StoreItems_tbl0036. 0037.                            Dim myStoreItemGroupId As Long = myManager.DefaultID()0038. 0039.                            StoreItemsDT = myManager.MyDb.GetDataTable(.GetSQLQueryWithGroups(myManager.ApplicationId(), True))0040. 0041.                            'MyRSI_cMyHelper.ShowNotepad(.GetSQLQuery(myManager.ApplicationId(), myManager.DefaultID(), myManager.DefaultID(), True))0042. 0043.                            If StoreItemsDT IsNot Nothing Then0044. 0045.                                'StoreItemsDT.Columns("Image").DataType.ToString()0046. 0047.                                For Each myDataRow As DataRow In StoreItemsDT.Rows0048.                                    If myDataRow("ImageThumbnail") Is DBNull.Value Then0049.                                        myDataRow("ImageThumbnail") = MyRSI_cMyHelper.GetBytes(Server.MapPath("~/RegisterPro/images/Common/not-avail-24.png"))0050.                                        StoreItemsDT.AcceptChanges()0051.                                    End If0052.                                    If myDataRow("StoreItemGroupId") Is DBNull.Value Then0053.                                        myDataRow("StoreItemGroupId") = myManager.DefaultID()0054.                                    End If0055.                                Next0056. 0057.                                ' we need to remove the rows we dont need0058.                                ' if we are Delete() - you cant go "Next" indexes are messed up, so exit for0059.                                ' you have to Step -1 0060.                                For i As Integer = StoreItemsDT.Rows.Count - 1 To 0 Step -10061.                                    If myStoreItemGroupId <> StoreItemsDT.Rows(i)("StoreItemGroupId") Then0062.                                        myStoreItemGroupId = StoreItemsDT.Rows(i)("StoreItemGroupId")0063.                                    ElseIf StoreItemsDT.Rows(i)("StoreItemGroupId") <> myManager.DefaultID() Then0064.                                        StoreItemsDT.Rows(i).Delete()0065.                                    End If0066.                                Next0067. 0068.                            End If0069. 0070. 0071.                        End With0072. 0073.                    End Using0074.                End Using0075. 0076.                myManager.Close()0077. 0078.            End Using0079. 0080.            Return StoreItemsDT0081. 0082.        End Get0083.    End Property0084. 0085.    Private ReadOnly Property GetStoreItemsWithGrpsDT(ByVal MyStoreItemGroupId As Long, ByVal MyProductLayoutItems As cMyManager.ProductLayoutItems) As DataTable0086.        Get0087. 0088.            Dim StoreItemsDT As DataTable = Nothing0089. 0090.            ' make sure we are disposing0091.            Using myManager As New cMyManager()0092.                ' make sure we are disposing0093.                Using MyRSI_StoreItems_tbl As New cMyManager.RSI_StoreItems_tbl(myManager)0094.                    Using MyRSI_cMyHelper As New cMyManager.cMyHelper()0095.                        With MyRSI_StoreItems_tbl0096. 0097.                            StoreItemsDT = myManager.MyDb.GetDataTable(.GetSQLQueryWithGroups(MyStoreItemGroupId, MyProductLayoutItems))0098. 0099.                            'Using cmyHelper As New cMyManager.cMyHelper(myManager)0100.                            '    cmyHelper.ShowNotepad(.GetSQLQueryWithGroups(MyStoreItemGroupId, MyProductLayoutItems))0101.                            'End Using0102.                        End With0103.                    End Using0104.                End Using0105. 0106.                myManager.Close()0107. 0108.            End Using0109. 0110.            Return StoreItemsDT0111. 0112.        End Get0113.    End Property0114. 0115.    Private ReadOnly Property GetStoreSettings(ByVal cMyManager As cMyManager) As DataTable0116.        Get0117. 0118.            ' make sure we are disposing0119.            Using RSI_StoreSettings_tbl As New cMyManager.RSI_StoreSettings_tbl(cMyManager)0120. 0121.                With RSI_StoreSettings_tbl0122.                    Return cMyManager.MyDb.GetDataTable(.GetSQLQuery())0123.                End With0124. 0125.                'Using MyRSI_cMyHelper As New cMyManager.cMyHelper()0126.                'MyRSI_cMyHelper.ShowNotepad(.GetSQLQuery(myManager.ApplicationId(), myManager.DefaultID(), myManager.DefaultID(), True))0127.                'End Using0128. 0129.            End Using0130. 0131.            Return Nothing0132. 0133.        End Get0134.    End Property0135. 0136.    Private ReadOnly Property GetGalleryImages(ByVal StoreItemId As Long, ByVal cMyManager As cMyManager) As DataTable0137.        Get0138. 0139.            ' make sure we are disposing0140.            Using RSI_StoreImages_tbl As New cMyManager.RSI_StoreImages_tbl(cMyManager)0141. 0142.                With RSI_StoreImages_tbl0143.                    Return cMyManager.MyDb.GetDataTable(.GetSQLQuery(StoreItemId))0144.                End With0145. 0146.                'Using MyRSI_cMyHelper As New cMyManager.cMyHelper()0147.                'MyRSI_cMyHelper.ShowNotepad(.GetSQLQuery(myManager.ApplicationId(), myManager.DefaultID(), myManager.DefaultID(), True))0148.                'End Using0149. 0150.            End Using0151. 0152.            Return Nothing0153. 0154.        End Get0155.    End Property0156. 0157.#End Region0158. 0159.    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load0160. 0161.        If Me.IsPostBack Then Return0162. 0163.        Using cMyManager As New cMyManager()0164.            Using cMyHelper As New cMyManager.cMyHelper(cMyManager)0165. 0166.                ' get the store settings0167.                Dim myDataTable As DataTable = Me.GetStoreSettings(cMyManager)0168.                Dim myVerCount As Int16 = -10169.                Dim myHorCount As Int16 = -10170.                Dim myUseStorePaging As Boolean = False0171. 0172.                If myDataTable IsNot Nothing Then0173.                    If myDataTable.Rows.Count > 0 Then0174. 0175.                        Dim myDataRow As DataRow = myDataTable.Rows(0)0176. 0177.                        ' get data0178.                        myVerCount = myDataRow("ItemsVerLayout")0179.                        myHorCount = myDataRow("ItemsHorLayout")0180.                        myUseStorePaging = myDataRow("UseStorePaging")0181.                        myHorCount = 30182.                        'set data0183.                        Me.RadListViewStoreItems.AllowPaging = myUseStorePaging0184.                        If myUseStorePaging Then0185.                            Me.RadListViewStoreItems.PageSize = myVerCount * myHorCount0186.                        End If0187. 0188.                        Me.RadDataPager3.Visible = myUseStorePaging0189.                        Me.RadDataPager4.Visible = myUseStorePaging0190. 0191.                        ' set up the viewstate0192.                        ViewState.Add("ItemsVerLayout", myVerCount) ' can be 1-30 (rows)0193.                        ViewState.Add("ItemsHorLayout", myHorCount) ' can be 1-3 (columns)0194. 0195.                        Dim myItemWidth As Int32 = 9500196.                        If myHorCount = 2 Then myItemWidth = Math.Floor(945 / myHorCount)0197.                        If myHorCount = 3 Then myItemWidth = Math.Floor(880 / myHorCount)0198. 0199.                        ViewState.Add("ItemWidth", Unit.Pixel(myItemWidth))  ' this is the actual item box width (1, 2, or 3 a row)0200.                        ViewState.Add("ItemHeight", Unit.Pixel(350))    ' always 350 pixels0201.                        ViewState.Add("HeightPage", Unit.Pixel(350 * myVerCount))    ' always 400 pixels0202.                        ViewState.Add("UseStorePaging", myUseStorePaging)   ' using paging or not0203.                        ViewState.Add("HorCount", myHorCount)   ' horizontal count of items0204. 0205.                        ' items in the layout0206.                        ViewState.Add("LayoutTop", myDataRow("LayoutTop"))0207.                        ViewState.Add("LayoutLeft", myDataRow("LayoutLeft"))0208.                        ViewState.Add("LayoutCenter", myDataRow("LayoutCenter"))0209.                        ViewState.Add("LayoutRight", myDataRow("LayoutRight"))0210.                        ViewState.Add("LayoutBottom", myDataRow("LayoutBottom"))0211. 0212.                        ' layout diagram0213.                        '-----[1]-----      {TopBottomWidth}0214.                        '-[2]-[3]-[4]-      {LeftWidth} - {CenterWidth} - {RightWidth}0215.                        '-----[5]-----      {TopBottomWidth}0216. 0217.                        ' normal layout - every container has items0218.                        ViewState.Add("TopBottomWidth", myItemWidth - 35)    ' {1} top/ {5} bottom width of items in the container0219.                        If myHorCount = 1 Then0220.                            ViewState.Add("LeftWidth", ((myItemWidth) - 42) / 3)         ' {2} left width of item in the container0221.                            ViewState.Add("CenterWidth", ((myItemWidth) - 42) / 3)       ' {3} left width of item in the container0222.                            ViewState.Add("RightWidth", ((myItemWidth) - 42) / 3)        ' {4} left width of item in the container0223.                        ElseIf myHorCount = 2 Then0224.                            ViewState.Add("LeftWidth", ((myItemWidth) - 35) / 3)         ' {2} left width of item in the container0225.                            ViewState.Add("CenterWidth", ((myItemWidth) - 35) / 3)       ' {3} left width of item in the container0226.                            ViewState.Add("RightWidth", ((myItemWidth) - 35) / 3)        ' {4} left width of item in the container0227.                        Else0228.                            ViewState.Add("LeftWidth", ((myItemWidth) - 38) / 3)         ' {2} left width of item in the container0229.                            ViewState.Add("CenterWidth", ((myItemWidth) - 38) / 3)       ' {3} left width of item in the container0230.                            ViewState.Add("RightWidth", ((myItemWidth) - 38) / 3)        ' {4} left width of item in the container0231.                        End If0232. 0233.                        ' widths are all based off of the middle cubes {2}, {3}, {4}0234.                        ' lets get the multiplier - the width that is multiplied by the multiplier0235.                        If myDataRow("LayoutLeft").ToString().Trim().Length() = 0 Then0236.                            If myDataRow("LayoutCenter").ToString().Trim().Length() = 0 Then0237.                                ' nothing in the left/center placeholder so lets add extra room in right cube0238.                                ViewState("RightWidth") *= 30239.                                ViewState("RightWidth") += 10    ' add the margin-right: 5px back in twice0240.                            ElseIf myDataRow("LayoutRight").ToString().Trim().Length() = 0 Then0241.                                ' left/right placeholder is empty0242.                                ViewState("CenterWidth") *= 30243.                                ViewState("CenterWidth") += 10   ' add the margin-right: 5px back in twice0244.                            Else0245.                                ' only the left placeholder is empty0246.                                ViewState("RightWidth") *= 20247.                                ViewState("RightWidth") += 5    ' add the margin-right: 5px back in0248.                            End If0249.                        ElseIf myDataRow("LayoutCenter").ToString().Trim().Length() = 0 Then0250.                            If myDataRow("LayoutRight").ToString().Trim().Length() = 0 Then0251.                                ' we are missing center and right so extend the left0252.                                ViewState("LeftWidth") *= 30253.                                ViewState("LeftWidth") += 10    ' add the margin-right: 5px back in twice0254.                            Else0255.                                ' only the center placeholder is empty0256.                                ViewState("RightWidth") *= 20257.                                ViewState("RightWidth") += 5    ' add the margin-right: 5px back in0258.                            End If0259.                        ElseIf myDataRow("LayoutRight").ToString().Trim().Length() = 0 Then0260.                            ViewState("CenterWidth") *= 20261.                            ViewState("CenterWidth") += 5    ' add the margin-right: 5px back in0262.                        End If0263. 0264.                        ' add other items to viewstate0265.                        ViewState.Add("CurrentDateTime", cMyManager.GetClientDateTimeNow())0266. 0267.                    End If0268. 0269.                End If0270. 0271.            End Using0272.        End Using0273. 0274. 0275.    End Sub0276. 0277.    Protected Sub RadListViewStoreItems_ItemCreated(sender As Object, e As RadListViewItemEventArgs) Handles RadListViewStoreItems.ItemCreated0278. 0279.        If TypeOf e.Item Is RadListViewDataItem Then0280. 0281.            Dim myRadListViewDataItem As RadListViewDataItem = DirectCast(e.Item, RadListViewDataItem)0282.            Dim myPlaceHolder As UI.WebControls.PlaceHolder = Nothing0283.            Dim mySplit() As String0284. 0285.            Using cMyManager As New cMyManager()0286.                Using cMyHelper As New cMyManager.cMyHelper(cMyManager)0287. 0288.                    Dim myProductLayoutItems As cMyManager.ProductLayoutItems = Global.cMyManager.ProductLayoutItems.Name0289.                    Dim myDiv As HtmlGenericControl = Nothing0290.                    Dim myHasControls As Boolean = False0291.                    Dim myStoreItemId As Long = myRadListViewDataItem.GetDataKeyValue("StoreItemId")0292. 0293.                    ' top ---------------------------------------------------------------------------------------------------------------------------------0294.                    myPlaceHolder = TryCast(myRadListViewDataItem.FindControl("PlaceHolderTop"), UI.WebControls.PlaceHolder)0295.                    ' see who is in the top0296.                    mySplit = Split(ViewState("LayoutTop"), "|")0297.                    For Each myElement As String In mySplit0298.                        If IsNumeric(myElement) Then0299.                            myHasControls = True0300.                            myProductLayoutItems = myElement0301.                            ' insert the control0302.                            Me.AddControl(myRadListViewDataItem, myProductLayoutItems, 0, myPlaceHolder, cMyManager)0303.                        End If0304.                    Next0305.                    myPlaceHolder.Visible = myHasControls0306.                    ' reset0307.                    myHasControls = False0308.                    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0309. 0310.                    ' left ---------------------------------------------------------------------------------------------------------------------------------0311.                    myPlaceHolder = TryCast(myRadListViewDataItem.FindControl("PlaceHolderLeft"), UI.WebControls.PlaceHolder)0312.                    ' see who is in the left0313.                    mySplit = Split(ViewState("LayoutLeft"), "|")0314.                    For Each myElement As String In mySplit0315.                        If IsNumeric(myElement) Then0316.                            myHasControls = True0317.                            myProductLayoutItems = myElement0318.                            ' insert the control0319.                            Me.AddControl(myRadListViewDataItem, myProductLayoutItems, 1, myPlaceHolder, cMyManager)0320.                        End If0321.                    Next0322.                    myDiv = TryCast(myRadListViewDataItem.FindControl("divLeft"), HtmlGenericControl)0323.                    myDiv.Style.Remove("width")0324.                    myDiv.Style.Add("width", ViewState("LeftWidth") & "px")0325.                    If Not myHasControls Then0326.                        myDiv.Style.Add("display", "none")0327.                    End If0328.                    'myDiv.Style.Add("background-color", "purple")0329.                    ' reset0330.                    myHasControls = False0331.                    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0332. 0333.                    ' center ---------------------------------------------------------------------------------------------------------------------------------0334.                    myPlaceHolder = TryCast(myRadListViewDataItem.FindControl("PlaceHolderCenter"), UI.WebControls.PlaceHolder)0335.                    ' see who is in the center0336.                    mySplit = Split(ViewState("LayoutCenter"), "|")0337.                    For Each myElement As String In mySplit0338.                        If IsNumeric(myElement) Then0339.                            myHasControls = True0340.                            myProductLayoutItems = myElement0341.                            ' insert the control0342.                            Me.AddControl(myRadListViewDataItem, myProductLayoutItems, 2, myPlaceHolder, cMyManager)0343.                        End If0344.                    Next0345.                    myDiv = TryCast(myRadListViewDataItem.FindControl("divCenter"), HtmlGenericControl)0346.                    myDiv.Style.Add("width", ViewState("CenterWidth") & "px")0347.                    If Not myHasControls Then0348.                        myDiv.Style.Add("display", "none")0349.                    End If0350.                    'myDiv.Style.Add("background-color", "red")0351.                    ' reset0352.                    myHasControls = False0353.                    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0354. 0355.                    ' right ---------------------------------------------------------------------------------------------------------------------------------0356.                    myPlaceHolder = TryCast(myRadListViewDataItem.FindControl("PlaceHolderRight"), UI.WebControls.PlaceHolder)0357.                    ' see who is in the right0358.                    mySplit = Split(ViewState("LayoutRight"), "|")0359.                    For Each myElement As String In mySplit0360.                        If IsNumeric(myElement) Then0361.                            myHasControls = True0362.                            myProductLayoutItems = myElement0363.                            ' insert the control0364.                            Me.AddControl(myRadListViewDataItem, myProductLayoutItems, 3, myPlaceHolder, cMyManager)0365.                        End If0366.                    Next0367.                    myDiv = TryCast(myRadListViewDataItem.FindControl("divRight"), HtmlGenericControl)0368.                    myDiv.Style.Add("width", ViewState("RightWidth") & "px")0369.                    If Not myHasControls Then0370.                        myDiv.Style.Add("display", "none")0371.                    End If0372.                    'myDiv.Style.Add("background-color", "green")0373.                    ' reset0374.                    myHasControls = False0375.                    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0376. 0377.                    ' bottom ---------------------------------------------------------------------------------------------------------------------------------0378.                    myPlaceHolder = TryCast(myRadListViewDataItem.FindControl("PlaceHolderBottom"), UI.WebControls.PlaceHolder)0379.                    ' see who is in the bottom0380.                    mySplit = Split(ViewState("LayoutBottom"), "|")0381.                    For Each myElement As String In mySplit0382.                        If IsNumeric(myElement) Then0383.                            myHasControls = True0384.                            myProductLayoutItems = myElement0385.                            ' insert the control0386.                            Me.AddControl(myRadListViewDataItem, myProductLayoutItems, 4, myPlaceHolder, cMyManager)0387.                        End If0388.                    Next0389.                    myPlaceHolder.Visible = myHasControls0390.                    ' reset0391.                    myHasControls = False0392.                    ' ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------0393. 0394.                    Dim myHorCount As Int16 = ViewState("ItemsHorLayout")0395. 0396.                    Dim myFieldSetItem As HtmlGenericControl = Nothing0397.                    myFieldSetItem = TryCast(myRadListViewDataItem.FindControl("FieldSetItem"), HtmlGenericControl)0398.                    myDiv = TryCast(myRadListViewDataItem.FindControl("divItemTemplate"), HtmlGenericControl)0399. 0400.                    If myHorCount = 1 Then0401.                        ' lets adjust the 'margin-right' for the items0402.                        myDiv.Style.Remove("width")0403.                        myDiv.Style.Add("width", "99%")0404.                        myFieldSetItem.Style.Remove("width")0405.                        myFieldSetItem.Style.Add("width", "97%")0406.                    ElseIf myHorCount = 2 Then0407.                        ' lets adjust the 'margin-right' for the items0408.                        myDiv.Style.Remove("width")0409.                        myDiv.Style.Add("width", "49.5%")0410.                        myFieldSetItem.Style.Remove("width")0411.                        myFieldSetItem.Style.Add("width", "95%")0412.                    Else    ' 3 items across0413.                        ' lets adjust the 'margin-right' for the items0414.                        myDiv = TryCast(myRadListViewDataItem.FindControl("FieldSetItem"), HtmlGenericControl)0415.                        myDiv.Style.Remove("width")0416.                        myDiv.Style.Add("width", "33%")0417.                    End If0418. 0419.                End Using0420.            End Using0421. 0422.        End If0423. 0424.    End Sub0425. 0426.    ''' <summary>0427.    ''' Add the control dynamically to the RadListView ItemTemplate.0428.    ''' </summary>0429.    ''' <param name="MyRadListViewDataItem">The radlistviewitem that we adding controls from its values</param>0430.    ''' <param name="ProductLayoutItems">The ProductLayoutItem the client has picked for this product to display</param>0431.    ''' <param name="MyPos">The position of the LayoutItem - 0(top), 1(left), 2(center), 3(right), 4(bottom)</param>0432.    ''' <param name="MyPlaceHolder">The actual placeholder for the items to be created in</param>0433.    ''' <param name="cMyManager"></param>0434.    ''' <remarks></remarks>0435.    Private Sub AddControl(ByVal MyRadListViewDataItem As RadListViewDataItem, ByVal ProductLayoutItems As cMyManager.ProductLayoutItems, ByVal MyPos As Int16, ByRef MyPlaceHolder As PlaceHolder, ByVal cMyManager As cMyManager)0436. 0437.        'Public Enum ProductLayoutItems0438.        '    Name = 00439.        '    Description = 10440.        '    SKU = 20441.        '    Price = 30442.        '    Discount = 40443.        '    Image = 50444.        '    Purchase_Button = 60445.        '    Stock_Status = 70446.        '    Remaining_in_Stock = 80447.        '    Color_Option = 90448.        '    Size_Option = 100449.        '    Custom_Option = 110450.        'End Enum0451. 0452.        'Exit Sub0453. 0454.        Dim myStoreItemId As Long = MyRadListViewDataItem.GetDataKeyValue("StoreItemId")0455.        Dim myStoreItemGroupId As Long = MyRadListViewDataItem.GetDataKeyValue("StoreItemGroupId")0456.        Dim myLabel As New Label()0457.        Dim myRadBinaryImage As New RadBinaryImage()0458.        Dim myRadImageGallery As New RadImageGallery()0459.        Dim myRadButton As New RadButton()0460.        Dim myHtmlAnchor As New HtmlAnchor()    ' href link0461.        Dim myHtmlGenericControl As New HtmlGenericControl()    ' div0462.        Dim myHtmlGenericControlContain As New HtmlGenericControl()    ' div0463.        Dim myRadNumericTextBox As New RadNumericTextBox()0464.        Dim myRadToolTip As New RadToolTip()0465.        Dim myRadComboBox As New RadComboBox()0466.        Dim myWidth As Double = 0D0467. 0468.        ' all divs get these styles0469.        myHtmlGenericControl.Style.Add("float", "left")0470. 0471.        ' container0472.        myHtmlGenericControlContain.Style.Add("width", "100%")0473.        myHtmlGenericControlContain.Style.Add("float", "left")0474. 0475.        ' get the placeholder position so we know what styles are needed for the divs0476.        Select Case MyPos0477.            Case 0  ' top0478.                myHtmlGenericControl.Style.Add("width", ViewState("TopBottomWidth") & "px")0479.                myHtmlGenericControl.Style.Add("margin-left", "33%")0480.                'myHtmlGenericControl.Style.Add("background-color", "blue")0481.                myWidth = ViewState("TopBottomWidth") / 20482. 0483.            Case 1  ' left0484.                myHtmlGenericControl.Style.Add("width", ViewState("LeftWidth") & "px")0485.                'myHtmlGenericControl.Style.Add("background-color", "red")0486.                myWidth = ViewState("LeftWidth")0487. 0488.            Case 2  ' center0489.                myHtmlGenericControl.Style.Add("width", ViewState("CenterWidth") & "px")0490.                'myHtmlGenericControl.Style.Add("background-color", "green")0491.                myWidth = ViewState("CenterWidth")0492. 0493.            Case 3  ' right0494.                myHtmlGenericControl.Style.Add("width", ViewState("RightWidth") & "px")0495.                myHtmlGenericControl.Style.Add("margin-left", "2px")0496.                'myHtmlGenericControl.Style.Add("background-color", "yellow")0497.                myWidth = ViewState("RightWidth")0498. 0499.            Case 4  ' bottom0500.                myHtmlGenericControl.Style.Add("width", ViewState("TopBottomWidth") & "px")0501.                myHtmlGenericControl.Style.Add("margin-left", "33%")0502.                'myHtmlGenericControl.Style.Add("background-color", "orange")0503.                myWidth = ViewState("TopBottomWidth")0504. 0505.        End Select0506. 0507. 0508.        Select Case ProductLayoutItems0509. 0510.            Case cMyManager.ProductLayoutItems.Name0511.                ' add the name0512.                myLabel.ID = "LabelName"0513.                myLabel.Width = New WebControls.Unit(Convert.ToDouble(myWidth))0514.                AddHandler myLabel.DataBinding, AddressOf Name_DataBinding0515. 0516.                myHtmlGenericControlContain.Controls.Add(myLabel)0517.                ' add to the div0518.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0519. 0520.                ' add to the placeholder0521.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0522. 0523.            Case cMyManager.ProductLayoutItems.Description0524.                ' add the Description0525.                myLabel.ID = "LabelDescription"0526.                myLabel.Width = New WebControls.Unit(Convert.ToDouble(myWidth))0527.                AddHandler myLabel.DataBinding, AddressOf Description_DataBinding0528. 0529.                ' add to the div0530.                myHtmlGenericControl.Controls.Add(myLabel)0531.                ' add to the placeholder0532.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0533. 0534.            Case cMyManager.ProductLayoutItems.SKU0535.                ' add the Description0536.                myLabel.ID = "LabelSKU"0537.                myLabel.Width = New WebControls.Unit(Convert.ToDouble(myWidth))0538.                AddHandler myLabel.DataBinding, AddressOf SKU_DataBinding0539. 0540.                ' add to the div0541.                myHtmlGenericControl.Controls.Add(myLabel)0542.                ' add to the placeholder0543.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0544. 0545.            Case cMyManager.ProductLayoutItems.Price0546.                ' add the Price0547.                myLabel.ID = "LabelPrice"0548.                AddHandler myLabel.DataBinding, AddressOf Price_DataBinding0549. 0550.                ' add to the div0551.                myHtmlGenericControl.Controls.Add(myLabel)0552.                ' add to the placeholder0553.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0554. 0555.            Case cMyManager.ProductLayoutItems.Discount0556.                ' add the Discount0557.                myLabel.ID = "LabelDiscount"0558.                AddHandler myLabel.DataBinding, AddressOf Discount_DataBinding0559. 0560.                ' add to the div0561.                myHtmlGenericControl.Controls.Add(myLabel)0562.                ' add to the placeholder0563.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0564. 0565.            Case cMyManager.ProductLayoutItems.Image0566.                ' we first need to add a lightbox for it HREF LINK0567.                myHtmlAnchor.ID = "LinkLightBox"0568.                myHtmlAnchor.Target = "_blank"0569.                myHtmlAnchor.Attributes("rel") = "lightbox"0570.                AddHandler myHtmlAnchor.DataBinding, AddressOf HtmlAnchor_DataBinding0571. 0572.                ' add the Image to the HtmlAnchor0573.                myRadBinaryImage.ID = "RadBinaryImage"0574.                myRadBinaryImage.BorderStyle = BorderStyle.Ridge0575.                myRadBinaryImage.BorderWidth = New WebControls.Unit(2)0576.                myRadBinaryImage.ResizeMode = BinaryImageResizeMode.Crop0577. 0578.                myRadBinaryImage.Width = New WebControls.Unit(Convert.ToDouble(myWidth))0579.                myRadBinaryImage.Height = New WebControls.Unit(Convert.ToDouble(myWidth))0580. 0581.                AddHandler myRadBinaryImage.DataBinding, AddressOf Image_DataBinding0582. 0583.                ' add the HtmlAnchor to the PlaceHolder0584.                myHtmlAnchor.Controls.Add(myRadBinaryImage)0585.                ' add to the div0586.                myHtmlGenericControl.Controls.Add(myHtmlAnchor)0587.                'myHtmlGenericControl.Controls.Add(myRadBinaryImage)0588. 0589.                myRadImageGallery.DisplayAreaMode = ImageGalleryDisplayAreaMode.LightBox0590.                myRadImageGallery.ThumbnailListView.DataSource = Me.GetGalleryImages(myStoreItemId, cMyManager)0591.                myRadImageGallery.ThumbnailsAreaSettings.ThumbnailsSpacing = New WebControls.Unit(3)0592.                myRadImageGallery.ThumbnailsAreaSettings.Height = New WebControls.Unit(Convert.ToDouble(35))0593.                myRadImageGallery.ThumbnailsAreaSettings.ShowScrollbar = False0594.                myRadImageGallery.ThumbnailsAreaSettings.ShowScrollButtons = False0595.                myRadImageGallery.ThumbnailsAreaSettings.Mode = ImageGalleryThumbnailsAreaMode.Thumbnails0596.                myRadImageGallery.ThumbnailsAreaSettings.EnableZoneScroll = True0597.                myRadImageGallery.ThumbnailListView.BorderStyle = BorderStyle.None0598.                myRadImageGallery.Width = New WebControls.Unit(Convert.ToDouble(myWidth))0599. 0600.                ' set the h/w of each thumbnailLigyth0601.                myRadImageGallery.ThumbnailsAreaSettings.ThumbnailHeight = New WebControls.Unit(28)0602.                myRadImageGallery.ThumbnailsAreaSettings.ThumbnailWidth = New WebControls.Unit(28)0603. 0604. 0605.                myRadImageGallery.DataSource = Me.GetGalleryImages(myStoreItemId, cMyManager)0606.                myRadImageGallery.DataThumbnailField = "ImageThumbnail"0607.                myRadImageGallery.DataImageField = "Image"0608.                myRadImageGallery.DataBind()0609. 0610.                myHtmlGenericControl.Controls.Add(myRadImageGallery)0611.                ' add to the placeholder0612.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0613. 0614.            Case cMyManager.ProductLayoutItems.Purchase_Button0615.                ' need a div for the Purhcase BUuton items0616.                'myHtmlGenericControlContain.Style.Add("text-align", "center")0617.                'myHtmlGenericControlContain.Style.Add("vertical-align", "middle")0618. 0619.                '<asp:Label runat="server" Text="Quantity:" />0620.                myLabel.Text = "<b>Quantity: </b>"0621.                myHtmlGenericControlContain.Controls.Add(myLabel)   ' add the label0622.                ' quantity box0623.                myRadNumericTextBox.ID = "RadNumericTextBoxQuantity"0624.                myRadNumericTextBox.MaxValue = 1000625.                myRadNumericTextBox.MinValue = 10626.                myRadNumericTextBox.Value = 10627.                myRadNumericTextBox.Width = New WebControls.Unit(45)0628.                myRadNumericTextBox.ShowSpinButtons = True0629.                myRadNumericTextBox.IncrementSettings.Step = 10630.                myRadNumericTextBox.NumberFormat.DecimalDigits = 00631.                myRadNumericTextBox.EnabledStyle.Width = New WebControls.Unit(50)0632.                myRadNumericTextBox.EnabledStyle.HorizontalAlign = HorizontalAlign.Center0633.                myHtmlGenericControlContain.Controls.Add(myRadNumericTextBox)   ' add the label0634. 0635.                ' add the quatity (numeric control) and purchase button0636.                myRadButton.ID = "RadButtonPurchase"0637.                myRadButton.Text = "Add to Cart"0638.                myRadButton.CommandName = "Submit"0639.                myRadButton.CommandArgument = "Submit"0640.                myRadButton.EnableViewState = True0641.                myRadButton.UseSubmitBehavior = True0642.                myRadButton.ButtonType = RadButtonType.StandardButton0643.                myRadButton.ViewStateMode = UI.ViewStateMode.Enabled0644.                myHtmlGenericControlContain.Controls.Add(myRadButton)   ' add the button0645. 0646.                ' add to the div0647.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0648. 0649.                ' extra style for button0650.                myHtmlGenericControl.Style.Add("margin-top", "10px")0651.                myHtmlGenericControl.Style.Add("margin-bottom", "10px")0652. 0653.                ' add to the placeholder0654.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0655. 0656.            Case cMyManager.ProductLayoutItems.Stock_Status0657.                ' add the Stock Status0658.                myLabel.ID = "LabelStockStatus"0659.                AddHandler myLabel.DataBinding, AddressOf StockStatus_DataBinding0660. 0661.                ' add to the div0662.                myHtmlGenericControl.Controls.Add(myLabel)0663.                ' add to the placeholder0664.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0665. 0666.            Case cMyManager.ProductLayoutItems.Remaining_in_Stock0667.                ' add the Stock Remain0668.                myLabel.ID = "LabelStockRemain"0669.                AddHandler myLabel.DataBinding, AddressOf StockLevel_DataBinding0670. 0671.                ' add to the div0672.                myHtmlGenericControl.Controls.Add(myLabel)0673.                ' add to the placeholder0674.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0675. 0676.            Case cMyManager.ProductLayoutItems.Color_Option ' could be combined item0677. 0678.                Dim myDataTable As DataTable = Me.GetStoreItemsWithGrpsDT(myStoreItemGroupId, ProductLayoutItems)0679.                If myDataTable IsNot Nothing Then0680.                    If myDataTable.Rows.Count < 1 Then0681.                        ' we might need to add a label "Color" no combobox0682.                        GoTo AddColorLabel0683.                    End If0684.                Else0685.                    Exit Select0686.                End If0687. 0688.                ' combobox - label and radcombobox0689.                myLabel.ID = "LabelColor"0690.                myLabel.Text = "<b>Color: </b>"0691.                'AddHandler myLabel.DataBinding, AddressOf Color_DataBinding0692.                myHtmlGenericControlContain.Controls.Add(myLabel)   ' add the label0693. 0694.                myRadComboBox.ID = "RadComboBoxColor"0695.                myRadComboBox.DataSource = myDataTable0696.                myRadComboBox.DataTextField = "Color"0697.                myRadComboBox.DataValueField = "StoreItemId"0698.                myRadComboBox.DataBind()0699. 0700.                'AddHandler myRadComboBox.DataBinding, AddressOf Color_DataBinding0701.                myHtmlGenericControlContain.Controls.Add(myRadComboBox)   ' add the radcombobox0702. 0703.                ' add to the div0704.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0705.                ' add to the placeholder0706.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0707. 0708.                Exit Select0709. 0710.AddColorLabel:0711. 0712.                ' label - there is not a grouped items0713.                myLabel.ID = "LabelColor"0714.                myLabel.Text = "<b>Color: </b>"0715.                AddHandler myLabel.DataBinding, AddressOf Color_DataBinding0716. 0717.                ' add the label0718.                myHtmlGenericControlContain.Controls.Add(myLabel)0719.                ' add to the div0720.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0721.                ' add to the placeholder0722.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0723. 0724.                Exit Select0725. 0726.            Case cMyManager.ProductLayoutItems.Size_Option ' could be combined item0727. 0728.                Dim myDataTable As DataTable = Me.GetStoreItemsWithGrpsDT(myStoreItemGroupId, ProductLayoutItems)0729. 0730.                If myDataTable IsNot Nothing Then0731.                    If myDataTable.Rows.Count < 1 Then0732.                        ' we might need to add a label "Color" no combobox0733.                        GoTo AddSizeLabel0734.                    End If0735.                Else0736.                    Exit Select0737.                End If0738. 0739.                ' combobox - label and radcombobox0740.                myLabel.ID = "LabelSize"0741.                myLabel.Text = "<b>Size: </b>"0742.                'AddHandler myLabel.DataBinding, AddressOf SizeString_DataBinding0743.                myHtmlGenericControlContain.Controls.Add(myLabel)   ' add the label0744. 0745.                myRadComboBox.ID = "RadComboBoxSize"0746.                myRadComboBox.AllowCustomText = False0747.                myRadComboBox.MarkFirstMatch = True0748.                myRadComboBox.Width = New WebControls.Unit(100D)0749.                myRadComboBox.DataSource = myDataTable0750.                If myDataTable.Rows(0)("SizeNumber") = "0.00" Then0751.                    myRadComboBox.DataTextField = "SizeString"0752.                Else0753.                    myRadComboBox.DataTextField = "SizeNumber"0754.                End If0755.                myRadComboBox.DataValueField = "StoreItemId"0756.                myRadComboBox.DataBind()0757. 0758.                'AddHandler myRadComboBox.DataBinding, AddressOf SizeString_DataBinding0759.                myHtmlGenericControlContain.Controls.Add(myRadComboBox)   ' add the radcombobox0760. 0761.                ' add to the div0762.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0763.                ' add to the placeholder0764.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0765. 0766.                Exit Select0767. 0768.AddSizeLabel:0769. 0770.                ' label - there is not a grouped items0771.                myLabel.ID = "LabelSize"0772.                myLabel.Text = "<b>Size: </b>"0773.                AddHandler myLabel.DataBinding, AddressOf Size_DataBinding0774. 0775.                ' add the label0776.                myHtmlGenericControlContain.Controls.Add(myLabel)0777.                ' add to the div0778.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0779.                ' add to the placeholder0780.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0781. 0782.                Exit Select0783. 0784.            Case cMyManager.ProductLayoutItems.Custom_Option ' could be combined item0785. 0786.                Dim myDataTable As DataTable = Me.GetStoreItemsWithGrpsDT(myStoreItemGroupId, ProductLayoutItems)0787. 0788.                If myDataTable IsNot Nothing Then0789.                    If myDataTable.Rows.Count < 1 Then0790.                        ' we might need to add a label "Color" no combobox0791.                        GoTo AddCustomLabel0792.                    End If0793.                Else0794.                    Exit Select0795.                End If0796. 0797.                ' combobox - label and radcombobox0798.                myLabel.ID = "LabelCustom"0799.                myLabel.Text = "<b>Custom: </b>"0800.                'AddHandler myLabel.DataBinding, AddressOf VarString_DataBinding0801.                myHtmlGenericControlContain.Controls.Add(myLabel)   ' add the label0802. 0803.                myRadComboBox.ID = "RadComboBoxCustom"0804.                myRadComboBox.AllowCustomText = False0805.                myRadComboBox.MarkFirstMatch = True0806.                myRadComboBox.Width = New WebControls.Unit(100D)0807.                myRadComboBox.DataSource = myDataTable0808.                myRadComboBox.DataTextField = "VarString"0809.                myRadComboBox.DataValueField = "StoreItemId"0810.                myRadComboBox.DataBind()0811. 0812.                'AddHandler myRadComboBox.DataBinding, AddressOf SizeString_DataBinding0813.                myHtmlGenericControlContain.Controls.Add(myRadComboBox)   ' add the radcombobox0814. 0815.                ' add to the div0816.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0817.                ' add to the placeholder0818.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0819. 0820.                Exit Select0821. 0822.AddCustomLabel:0823. 0824.                ' label - there is not a grouped items0825.                myLabel.ID = "LabelCustom"0826.                myLabel.Text = "<b>Custom: </b>"0827.                AddHandler myLabel.DataBinding, AddressOf VarString_DataBinding0828. 0829.                ' add the label0830.                myHtmlGenericControlContain.Controls.Add(myLabel)0831.                ' add to the div0832.                myHtmlGenericControl.Controls.Add(myHtmlGenericControlContain)0833.                ' add to the placeholder0834.                MyPlaceHolder.Controls.Add(myHtmlGenericControl)0835. 0836.                Exit Select0837. 0838.        End Select0839. 0840.    End Sub0841. 0842.#Region " Client Protected Methods "0843. 0844.    Sub Name_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0845.        Dim Label As Label = DirectCast(sender, Label)0846.        Label.Text = "<b>Name:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("NameTextHTML").ToString()0847.    End Sub0848.    Sub Description_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0849.        Dim Label As Label = DirectCast(sender, Label)0850.        Label.Text = "<b>Description:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("DescriptionTextHTML").ToString()0851.    End Sub0852.    Sub SKU_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0853.        Dim Label As Label = DirectCast(sender, Label)0854.        Label.Text = "<b>SKU:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("SKUTextHTML").ToString()0855.    End Sub0856.    Sub Price_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0857.        Dim Label As Label = DirectCast(sender, Label)0858.        Dim myCurrency As Double = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("ListPriceTextHTML").ToString()0859.        Label.Text = "<b>Price:</b> " & Format(myCurrency, "$#,##0.00")0860.    End Sub0861.    Sub Discount_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0862.        Dim Label As Label = DirectCast(sender, Label)0863.        Dim myUseDiscount As Boolean = Convert.ToBoolean((TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("UseDiscount"))0864.        Dim myListPrice As Double = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("ListPrice").ToString()0865.        Dim myDiscountedPrice As Double = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("DiscountedPrice").ToString()0866.        Dim myDiscountedPct As Double = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("DiscountedPct").ToString()0867.        Dim myCurrentDateTime As DateTime = ViewState("CurrentDateTime")0868. 0869.        ' not using discount so hide and exit0870.        If Not myUseDiscount Then Label.Visible = False : Exit Sub0871. 0872.        ' check for dates0873.        Dim myStartDate As DateTime = Convert.ToDateTime((TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("DiscountStartDate"))0874.        Dim myEndDate As DateTime = Convert.ToDateTime((TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("DiscountEndDate"))0875. 0876.        Dim myCurrency As Double = myDiscountedPrice0877. 0878.        ' its between the dates so we show the discount0879.        If myStartDate < myCurrentDateTime And myEndDate > myCurrentDateTime Then0880.            If myCurrency = 0 Then0881.                ' get the percentage0882.                myCurrency = (myListPrice * myDiscountedPct) / 1000883.            End If0884.        Else0885.            ' its outside the date range so lets hide the discount0886.            Label.Visible = False : Exit Sub0887.        End If0888. 0889.        Label.Text = "<b>Price After Discount:</b> " & Format(myCurrency, "$#,##0.00")0890. 0891.        Label.Visible = myCurrency > 0D0892.    End Sub0893.    Sub StockStatus_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0894.        Dim Label As Label = DirectCast(sender, Label)0895.        Label.Text = "<b>Stock Status:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("StockStatusValuesId").ToString()0896.        If Convert.ToInt64((TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("StockStatusValuesId").ToString()) < 0 Then0897.            Label.Visible = False0898.        End If0899.    End Sub0900.    Sub StockLevel_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0901.        Dim Label As Label = DirectCast(sender, Label)0902.        Label.Text = "<b>Stock Level:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("StockLevel").ToString()0903. 0904.        Dim myUseStockLevel As Boolean = Convert.ToBoolean((TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("UseStockLevel"))0905.        Label.Visible = myUseStockLevel0906. 0907.    End Sub0908.    Sub Image_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0909.        Dim myRadBinaryImage As RadBinaryImage = DirectCast(sender, RadBinaryImage)0910.        myRadBinaryImage.DataValue = CType(DataBinder.Eval(CType(myRadBinaryImage.NamingContainer, RadListViewDataItem).DataItem, "ImageThumbnail"), Byte())0911.        myRadBinaryImage.ToolTip = (TryCast((TryCast(myRadBinaryImage.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("Name").ToString()0912.        myRadBinaryImage.AlternateText = (TryCast((TryCast(myRadBinaryImage.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("Name").ToString()0913. 0914.        'myRadBinaryImage.ClientSideEvents.Click = String.Format("function(s, e) { ShowPopup(s, e, {0}) }", DataBinder.Eval(container.DataItem, "ID"))0915.    End Sub0916.    Sub HtmlAnchor_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0917.        Dim myHtmlAnchor As HtmlAnchor = DirectCast(sender, HtmlAnchor)0918.        Dim myStoreItemId As Long = (TryCast((TryCast(myHtmlAnchor.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("StoreItemId").ToString()0919.        myHtmlAnchor.HRef = "~/RegisterPro/ImageHandler.ashx?Id=" & myStoreItemId & "&TableName=RSI_StoreImages_tbl"0920.        'href='<%# Eval("StoreItemId", "~/RegisterPro/ImageHandler.ashx?Id={0}&TableName=RSI_StoreImages_tbl")%>'>0921.    End Sub0922.    Sub Color_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0923.        Dim Label As Label = DirectCast(sender, Label)0924.        Label.Visible = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("Color").ToString().Length > 00925.        Label.Text = "<b>Color:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("Color").ToString()0926.    End Sub0927.    Sub Size_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0928.        Dim Label As Label = DirectCast(sender, Label)0929.        If (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("SizeString").ToString().Length = 0 Then0930.            If (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("SizeNumber").ToString() = "0.00" Then0931.                ' we dont have a size - empty string and 0.000932.                Label.Visible = False0933.            Else0934.                ' we have a Number for size0935.                Label.Text = "<b>Size:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("SizeNumber").ToString()0936.            End If0937.        Else0938.            ' we have a String for size0939.            Label.Text = "<b>Size:</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("SizeString").ToString()0940.        End If0941. 0942.    End Sub0943.    Sub VarString_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)0944.        Dim Label As Label = DirectCast(sender, Label)0945.        Label.Visible = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("VarString").ToString().Length > 00946.        Dim myVarLabelName As String = (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("VarLabelName").ToString()0947.        Label.Text = String.Concat("<b>", myVarLabelName, ":</b> " & (TryCast((TryCast(Label.NamingContainer, RadListViewDataItem)).DataItem, DataRowView))("VarString").ToString())0948.    End Sub0949. 0950.    Protected ReadOnly Property ItemWidth() As Unit0951.        Get0952.            Return DirectCast(ViewState("ItemWidth"), Unit)0953.        End Get0954.    End Property0955. 0956.    Protected ReadOnly Property ItemHeight() As Unit0957.        Get0958.            Return DirectCast(ViewState("ItemHeight"), Unit)0959.        End Get0960.    End Property0961. 0962.    Protected ReadOnly Property HeightPage() As Unit0963.        Get0964.            Return DirectCast(ViewState("HeightPage"), Unit)0965.        End Get0966.    End Property0967. 0968.#End Region0969. 0970.    Protected Sub RadListViewStoreItems_NeedDataSource(sender As Object, e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles RadListViewStoreItems.NeedDataSource0971.        Me.RadListViewStoreItems.DataSource = Me.GetStoreItemsWithGrpsDT()0972.    End Sub0973. 0974.    Protected Sub RadListViewStoreItems_ItemCommand(sender As Object, e As Telerik.Web.UI.RadListViewCommandEventArgs) Handles RadListViewStoreItems.ItemCommand0975. 0976.        Dim myRadTextBox As RadTextBox = Nothing0977.        Dim myRadNumericTextBox As RadNumericTextBox = Nothing0978.        Dim myRadButton As RadButton = Nothing0979.        Dim myAmount As Double = 0D0980.        Dim myQuantity As Int32 = 10981.        Dim myStockLevel As Int32 = 10982.        Dim myStoreItemId As Long = 00983. 0984.        Dim myName As String = String.Empty0985.        Dim myDescription As String = String.Empty0986.        Dim mySKU As String = String.Empty0987. 0988.        Dim myCurrentDateTime As DateTime = ViewState("CurrentDateTime")0989.        Dim myListPrice As Double = 0D0990. 0991.        If e.CommandName = "Submit" Then0992. 0993.            If TypeOf e.ListViewItem Is RadListViewDataItem Then0994. 0995.                myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxName"), RadTextBox)0996.                myName = myRadTextBox.Text0997.                myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxDescription"), RadTextBox)0998.                myDescription = myRadTextBox.Text0999.                myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxSKU"), RadTextBox)1000.                mySKU = myRadTextBox.Text1001.                myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxStoreItemId"), RadTextBox)1002.                myStoreItemId = myRadTextBox.Text1003. 1004.                myRadNumericTextBox = TryCast(e.ListViewItem.FindControl("RadNumericTextBoxQuantity"), RadNumericTextBox)1005.                myQuantity = myRadNumericTextBox.Value1006. 1007. 1008.                ' lets see if there is enough stock - they need to be using stock as well1009.                myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxUseStockLevel"), RadTextBox)1010.                If Convert.ToBoolean(myRadTextBox.Text) = True Then1011.                    myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxStockLevel"), RadTextBox)1012.                    myStockLevel = Convert.ToInt32(myRadTextBox.Text)1013.                    If myStockLevel < myQuantity Then1014.                        Me.RadWindowManager1.RadAlert(String.Concat("There are only <b>", myStockLevel, "</b> items left in stock for the <b>", myName, "</b> product.<br /><br />Please adjusst your quantity."), 500, 200, "Inventory Low", String.Empty, ImageMinorError)1015.                        e.Canceled = True1016.                        Exit Sub1017.                    End If1018.                End If1019. 1020.                ' check price and see discount - preset to ListPrice1021.                myListPrice = TryCast(e.ListViewItem.FindControl("RadTextBoxListPrice"), RadTextBox).Text1022.                If TryCast(e.ListViewItem.FindControl("RadButtonUseDiscount"), RadButton).Checked Then1023.                    ' using discount1024.                    Dim myStartDate As DateTime = TryCast(e.ListViewItem.FindControl("RadTextBoxDiscountStartDate"), RadTextBox).Text1025.                    Dim myEndDate As DateTime = TryCast(e.ListViewItem.FindControl("RadTextBoxDiscountEndDate"), RadTextBox).Text1026.                    ' check dates1027.                    If myStartDate < myCurrentDateTime And myEndDate > myCurrentDateTime Then1028.                        ' default get the discounted price1029.                        myAmount = TryCast(e.ListViewItem.FindControl("RadTextBoxDiscountedPrice"), RadTextBox).Text1030.                        If myAmount = 0 Then1031.                            ' get the percentage - no discounted price used1032.                            myAmount = TryCast(e.ListViewItem.FindControl("RadTextBoxDiscountedPct"), RadTextBox).Text1033.                            myAmount = (myListPrice * myAmount) / 1001034.                        End If1035.                        myRadTextBox = TryCast(e.ListViewItem.FindControl("RadTextBoxDiscountedPrice"), RadTextBox)1036.                        ' set the discounted price1037.                        myListPrice = myAmount1038.                    End If1039.                End If1040. 1041. 1042.                'ViewState.Add("ID", myDataTable.Rows.Count)1043.                ViewState.Add("StoreItemId", myStoreItemId)1044.                ViewState.Add("Name", myName)1045.                ViewState.Add("Description", myDescription)1046.                ViewState.Add("SKU", mySKU)1047.                ViewState.Add("Price", myListPrice)1048.                ViewState.Add("Quantity", myQuantity)1049.                ViewState.Add("TotalPrice", Format(myQuantity * myListPrice, "#,##0.00"))1050. 1051.                ' get the entry to put it in1052.                Dim myDataTable As New DataTable("ShopCartDT")1053. 1054.                myDataTable = Session.Item("ShopCartDT")1055. 1056.                Dim myDataRow As DataRow = myDataTable.Rows.Add()1057. 1058.                myDataRow("ID") = myDataTable.Rows.Count1059.                myDataRow("StoreItemId") = myStoreItemId1060.                myDataRow("MemberId") = Session.Item("cur_MemberId")1061.                myDataRow("Name") = myName1062.                myDataRow("Description") = myDescription1063.                myDataRow("SKU") = mySKU1064.                myDataRow("Price") = myListPrice1065.                myDataRow("Quantity") = myQuantity1066.                myDataRow("TotalPrice") = Format(myQuantity * myListPrice, "#,##0.00")1067. 1068.                ' write it back out1069.                Session.Item("ShopCartDT") = myDataTable1070. 1071.                Me.RadWindowManager1.RadAlert(String.Concat("Item <b>", myName, "</b> has been added to your shopping cart."), 400, 125, "Shop Cart Updated", String.Empty, ImageInfo)1072. 1073. 1074.            End If1075.        End If1076. 1077.    End Sub1078. 1079. 1080.    1081.End ClassThanks
0
                                
                                                    SDI
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 23 Mar 2015, 02:41 PM
                                            
                                        maybe this will help shed some light on it
 
When the page loads there are no errors. the images and their thumbnails show appropriately for each item in the radlsitview. if i
click on a thumbnail the lightbox pops up and ajax runs, note this is the first time clicking. if there are multiple thumbnails or just one, it shows up fine.it shows the Ajax running in the lightbox. BUT if i dont click on the firstimage in the thumbnail list, say there are 4 and i click on number 2, no ajax is fired. The lightbox shows 1 of 4, then it suddenly switches to 2 of 4 and
displays the image. now again this is the first time even clicking an any thumbnail on any of the radlistview item gallery thumbnails. after the first time clicking on any thumbnail it will pop up with the "fake" directory error. This happens in the ligtbox pop navigation
and if i click on the thumbnail in the gallery. It loads the image fine, but why is it looking for a file in the "fake" directory.
we need to get this store out there soon, i am not sure if this error will pop up on the site, this is all happening in the environment right now. as you can see from the previous post the code is still in the testing stages.
                                        When the page loads there are no errors. the images and their thumbnails show appropriately for each item in the radlsitview. if i
click on a thumbnail the lightbox pops up and ajax runs, note this is the first time clicking. if there are multiple thumbnails or just one, it shows up fine.it shows the Ajax running in the lightbox. BUT if i dont click on the firstimage in the thumbnail list, say there are 4 and i click on number 2, no ajax is fired. The lightbox shows 1 of 4, then it suddenly switches to 2 of 4 and
displays the image. now again this is the first time even clicking an any thumbnail on any of the radlistview item gallery thumbnails. after the first time clicking on any thumbnail it will pop up with the "fake" directory error. This happens in the ligtbox pop navigation
and if i click on the thumbnail in the gallery. It loads the image fine, but why is it looking for a file in the "fake" directory.
we need to get this store out there soon, i am not sure if this error will pop up on the site, this is all happening in the environment right now. as you can see from the previous post the code is still in the testing stages.
0
                                Hello,
I have carefully examined the provided code but was not able to pin-point the culprit behind this behavior. As I mentioned it would be hard to tell what exactly triggers the problem without replicating it locally. Having that in mind I would kindly like to ask you to try and assemble a small runnable sample which we can debug.
Additionally if the application uses an older version of the controls please upgrade to the latest and test it again.
Regards,
Angel Petrov
Telerik 
 
                                        I have carefully examined the provided code but was not able to pin-point the culprit behind this behavior. As I mentioned it would be hard to tell what exactly triggers the problem without replicating it locally. Having that in mind I would kindly like to ask you to try and assemble a small runnable sample which we can debug.
Additionally if the application uses an older version of the controls please upgrade to the latest and test it again.
Regards,
Angel Petrov
Telerik
See What's Next in App Development. Register for TelerikNEXT.
0
                                
                                                    Jamie Hassall
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 02 Apr 2015, 01:16 PM
                                            
                                        I also get this "fake" issue. Happens when scrolling through the popped up lightbox. Lightbox also closes itself when it happens.
Chrome console
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
 
 
 
 
 
                                        Chrome console
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
fake:1 GET http://localhost:88/Content/fake 404 (Not Found)
         <telerik:RadImageGallery ID="radGallery" runat="server" DisplayAreaMode="LightBox"  RenderMode="Lightweight" Width="100px"             OnNeedDataSource="radGallery_NeedDataSource" />Protected Sub radGallery_NeedDataSource(sender As Object, e As ImageGalleryNeedDataSourceEventArgs)    Using db As New ReactOnlineDB        Dim images = (From img In db.CandidateImage Where Not img.Image Is Nothing).ToList()        radGallery.DataImageField = "Image"        radGallery.DataSource = images    End UsingEnd Sub0
                                Hi Jamie,
I tried reproducing the problem in an isolated sample but was unable to do so. In my case both the gallery using binary data and the one using image URLs was displaying the images correctly.
Could you please examine the attachment and tell us what differs in your case? Additionally if you can modify it in such a manner so that the problem can be replicated that would be great.
Regards,
Angel Petrov
Telerik 
 
                                        I tried reproducing the problem in an isolated sample but was unable to do so. In my case both the gallery using binary data and the one using image URLs was displaying the images correctly.
Could you please examine the attachment and tell us what differs in your case? Additionally if you can modify it in such a manner so that the problem can be replicated that would be great.
Regards,
Angel Petrov
Telerik
See What's Next in App Development. Register for TelerikNEXT.