This is a migrated thread and some comments may be shown as answers.

object not found error when clicking row in grid

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chom
Top achievements
Rank 1
Chom asked on 26 Mar 2010, 06:24 PM

Hi all

I am getting an error on my page when I try to load a popup window and have been trying for several days resolve this issue.

I have three hierarchy grids on my page one contains a grid binary image column.

Here is my code

 

<%@ Page Title="" Language="VB" MasterPageFile="~/admin/adminmaster.master" AutoEventWireup="false" 
    CodeFile="pricingoptions.aspx.vb" Inherits="admin_secure_businesslistings_sales_businesspriceplan" %> 
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> 
<%@ Register Assembly="skmControls2" Namespace="skmControls2" TagPrefix="cc1" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">  
    <link href="styles/buslistingsales1.css" rel="stylesheet" type="text/css" /> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
 
 
<%--    <script type="text/javascript">  
        function showForm() {  
            window.open("PreviewListing.aspx", "");  
        }  
    </script>--%> 
      
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
 
        <script type="text/javascript">  
            // <![CDATA[
            // on insert and update buttons, temporarily disable AJAX // to allow upload actions
//                                function mngRequestStarted(sender, eventArgs) {
//                                    var re = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
//                                    if (eventArgs.EventTarget.match(re)) {
//                                        eventArgs.EnableAjax = false;
//                                    }
//                                }
            function conditionalPostback(sender, eventArgs) {
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                if (eventArgs.get_eventTarget().match(theRegexp)) {
                    var upload = $find(window['UploadId']);
                    //AJAX is disabled only if file is selected for upload
                    if (upload.getFileInputs()[0].value != "") {
                        eventArgs.set_enableAjax(false);
                    }
                }
            }
            function validateRadUpload(source, e) {
                e.IsValid = false;
                var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                var inputs = upload.getFileInputs();
                for (var i = 0; i < inputs.length; i++) {
                    //check for empty string or invalid extension
                    if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                        e.IsValid = true;
                        break;
                    }
                }
            }
            
    MyModule = function(element) {
        MyModule.initializeBase(this, [element]);
    }
    MyModule.prototype =
{
    initialize: function() {
        MyModule.callBaseMethod(this, 'initialize');
        var selfPointer = this;
        this.get_editor().add_selectionChange(function() { selfPointer.CountCharAction(); });
        this.get_editor().attachEventHandler("onkeyup", function() { selfPointer.CountCharAction(); });
        this.CountCharAction();
    },
    //A method that does the actual work - it is usually attached to the "selection changed" editor event
    CountCharAction: function() {
        var content = this.get_editor().get_html(true);
        var words = 0;
        var chars = 0;
        if (content) {
            punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g;
            content = content.replace(punctRegX, "");
            trimRegX = /(^\s+)|(\s+$)/g;
            content = content.replace(trimRegX, "");
            if (content) {
                splitRegX = /\s+/;
                var array = content.split(splitRegX);
                words = array.length;
                chars = content.length;
            }
        }
        var element = this.get_element();
        element.innerHTML = "<span style='line-height:22px'>" + "Words: " + words + " Characters: " + chars + "&nbsp;</span>";
        element.style.border = "1px solid red";
        element.style.backgroundColor = "yellow";
        element.style.color = "red";
    }
};
    MyModule.registerClass('MyModule', Telerik.Web.UI.Editor.Modules.ModuleBase);
            // ]]> 
        </script> 
 
    </telerik:RadCodeBlock> 
    <asp:SqlDataSource ID="dsBusinessListingDescription" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
        SelectCommand="admin_Settings_GetBusinessListingDescription" SelectCommandType="StoredProcedure">  
        <SelectParameters> 
            <asp:Parameter Name="BusinessListingIndex" Type="Int16" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <div class="heading">  
        Business Listings: Plan and Pricing Options</div> 
    <div class="saContent">  
        <div class="saFiltering">  
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback" Width="845px">  
 
                <div class="controlsdiv">  
                    <table class="TableAddress" style="margin-bottom: 10px;">  
                        <tr> 
                            <td class="TextRight">  
                                Username:  
                            </td> 
                            <td class="TextLeft">  
                                <asp:Label ID="lblUserName" runat="server" ForeColor="Blue"></asp:Label> 
                            </td> 
                            <td class="TextRight">  
                                Customer ID:  
                            </td> 
                            <td class="TextLeft">  
                                <asp:Label ID="lblCustomerID" runat="server" ForeColor="Blue"></asp:Label> 
                            </td> 
                        </tr> 
                    </table> 
                </div> 
                <div class="controlsdiv">  
                    <table class="TableAddress" style="margin-bottom: 5px;">  
                        <tr> 
                            <td class="TextLeft">  
                                <b>1. Business Listings:</b><br /> 
                                Select the type of listing to add business to below.  
                            </td> 
                        </tr> 
                    </table> 
                    <telerik:RadTabStrip ID="RadTabStripListings" runat="server" MultiPageID="ListingsMultiPage" 
                        SelectedIndex="0">  
                        <Tabs> 
                            <telerik:RadTab runat="server" Text="Listings with Slides for each business" /> 
                            <telerik:RadTab runat="server" Text="Listings with No Slides for any business" /> 
                            <telerik:RadTab runat="server" Text="Listings with 1 set of common Slides for all businesses" 
                                Selected="True" /> 
                        </Tabs> 
                    </telerik:RadTabStrip> 
                    <telerik:RadMultiPage ID="ListingsMultiPage" runat="server" Width="100%" SelectedIndex="0">  
                        <telerik:RadPageView ID="ListingsPageViewWithImages" runat="server"><div class="tabDivTop">  
                          
                            <asp:SqlDataSource ID="dsBusinessListings" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
                                SelectCommand="admin_Customers_BusinessListing_SelectPrimaryInfo" SelectCommandType="StoredProcedure" 
                                InsertCommand="admin_Customers_BusinessListing_InsertPrimaryInfo" InsertCommandType="StoredProcedure" 
                                DeleteCommand="admin_Customers_BusinessListing_DeleteRowPrimaryInfo" DeleteCommandType="StoredProcedure">  
                                <SelectParameters> 
                                    <asp:Parameter Name="CustomerID" Type="String" /> 
                                    <asp:Parameter Name="OrderID" Type="String" /> 
                                    <asp:Parameter Name="WithSlideNoSlide" Type="String" /> 
                                </SelectParameters> 
                                <InsertParameters> 
                                    <asp:Parameter Name="CustomerID" Type="String" /> 
                                    <asp:Parameter Name="OrderID" Type="String" /> 
                                    <asp:Parameter Name="TabStripSelectedIndex" Type="Int16" /> 
                                    <asp:Parameter Name="BusinessListingDescription" Type="String" /> 
                                    <asp:Parameter Name="WithSlideNoSlide" Type="String" /> 
                                </InsertParameters> 
                                <DeleteParameters> 
                                    <asp:Parameter Name="CustomerID" Type="String" /> 
                                    <asp:Parameter Name="OrderID" Type="String" /> 
                                    <asp:Parameter Name="BusinessListingNumber" Type="Int16" /> 
                                    <asp:Parameter Name="WithSlideNoSlide" Type="String" /> 
                                    <asp:Parameter Name="TabStripSelectedIndex" Type="Int16" /> 
                                </DeleteParameters> 
                            </asp:SqlDataSource> 
                                      
                            <telerik:RadGrid ID="rgListingWithImages" runat="server" GridLines="None" Skin="Office2007" 
                                PageSize="8" ClientSettings-Scrolling-SaveScrollPosition="true" AllowPaging="True">  
                                <HeaderStyle HorizontalAlign="Left" /> 
                                <ItemStyle HorizontalAlign="Left" /> 
                                <AlternatingItemStyle HorizontalAlign="Left" /> 
                                <ClientSettings EnablePostBackOnRowClick="true">  
                                    <Selecting AllowRowSelect="true" /> 
                                </ClientSettings> 
                                <PagerStyle Mode="NumericPages" /> 
                                <MasterTableView PageSize="5" AutoGenerateColumns="False" DataKeyNames="ID" CommandItemDisplay="Top" 
                                    ShowHeadersWhenNoRecords="true" NoMasterRecordsText="Insert New Business Listing.">  
                                    <Columns> 
                                        <telerik:GridButtonColumn CommandName="DeleteRow" CommandArgument="DeleteRow" HeaderText="" 
                                            Text="Delete" UniqueName="DeleteRow">  
                                        </telerik:GridButtonColumn> 
                                        <telerik:GridBoundColumn DataField="ID" DefaultInsertValue="" HeaderText="ID" SortExpression="ID" 
                                            UniqueName="ID" DataType="System.Int32" ReadOnly="True" Visible="false">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="CustomerID" DefaultInsertValue="" HeaderText="CustomerID" 
                                            SortExpression="CustomerID" UniqueName="CustomerID" Visible="false">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="OrderID" DefaultInsertValue="" HeaderText="OrderID" 
                                            SortExpression="OrderID" UniqueName="OrderID">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="OrderDate" DataType="System.DateTime" DefaultInsertValue="" 
                                            HeaderText="OrderDate" SortExpression="OrderDate" UniqueName="OrderDate" Visible="false">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="BusinessListingNumber" DataType="System.Int32" 
                                            DefaultInsertValue="" HeaderText="Business Number" SortExpression="BusinessListingNumber" 
                                            UniqueName="BusinessListingNumber">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="NumberOfImages" DataType="System.Int32" DefaultInsertValue="" 
                                            HeaderText="Slides" SortExpression="Number Of Images" UniqueName="NumberOfImages">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="NumberOfCategories" DataType="System.Int32" DefaultInsertValue="" 
                                            HeaderText="Categories" SortExpression="Number Of Categories" UniqueName="NumberOfCategories">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="BusinessListingDescription" DefaultInsertValue="" 
                                            HeaderText="Description" SortExpression="BusinessListingDescription" UniqueName="BusinessListingDescription">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridButtonColumn CommandName="SaveData" CommandArgument="SaveData" HeaderText="" 
                                            Text="Save" UniqueName="SaveData" ButtonType="PushButton">  
                                        </telerik:GridButtonColumn> 
<%--                                        <telerik:GridTemplateColumn UniqueName="btnPreview">  
                                        <ItemTemplate> 
                                            <asp:Button ID="btnPreview" runat="server" OnClientClick="showForm()" CommandName="Preview" Text ="Preview" /> 
                                        </ItemTemplate> 
                                        </telerik:GridTemplateColumn>--%> 
                                        <telerik:GridButtonColumn CommandName="Preview" CommandArgument="Preview" HeaderText="" 
                                            Text="Preview" UniqueName="Preview">  
                                        </telerik:GridButtonColumn> 
                                    </Columns> 
                                    <PagerStyle Mode="NextPrev" /> 
                                    <CommandItemTemplate> 
                                        <table style="float: left; width: 100%;">  
                                            <tr> 
                                                <td style="text-align: left">  
                                                    <asp:Button ID="btnInsertNewRecord" runat="server" CommandName="InsertNewRecord" 
                                                        Text="New Listing" Width="90px" Height="25px" /> 
                                                </td> 
                                                <td> 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </CommandItemTemplate> 
                                </MasterTableView></telerik:RadGrid> 
                                                              
                                                            </div></telerik:RadPageView> 
                        <telerik:RadPageView ID="ListingsPageViewwithoutImages" runat="server"><div class="tabDivTop"></div></telerik:RadPageView> 
                        <telerik:RadPageView ID="ListingsPageViewSlides" runat="server"><div class="tabDivTop"></div></telerik:RadPageView> 
                    </telerik:RadMultiPage> 
                </div> 
                <div style="float: left; width: 100%">  
                    <table class="TableAddress" style="margin-bottom: 10px; width: 100%">  
                        <tr> 
                            <td class="TextLeft">  
                                <b>2. Slides</b> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="TextLeft">  
                                Slides for Business Listings.  
                            </td> 
                        </tr> 
                    </table> 
                </div> 
                <div class="controlsdiv">  
                    <asp:SqlDataSource ID="dsSlides" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
                        SelectCommand="admin_Customers_BusinessListings_Slides_SelectSlideInfo_1" SelectCommandType="StoredProcedure" 
                        InsertCommand="admin_Customers_BusinessListings_Slides_InsertPrimaryInfo" InsertCommandType="StoredProcedure" 
                        DeleteCommand="admin_Customers_BusinessListings_Slides_DeleteSlideRow_1" DeleteCommandType="StoredProcedure" 
                        UpdateCommand="admin_Customers_BusinessListings_Slides_UpdateSlideInfo_1" UpdateCommandType="StoredProcedure">  
                        <SelectParameters> 
                            <asp:Parameter Name="CustomerID" /> 
                            <asp:Parameter Name="OrderID" /> 
                            <asp:Parameter Name="BusinessListingNumber" /> 
                        </SelectParameters> 
                        <InsertParameters> 
                            <asp:Parameter Name="CustomerID" Type="String" /> 
                            <asp:Parameter Name="OrderID" Type="String" /> 
                            <asp:Parameter Name="BusinessListingNumber" Type="Int16" /> 
                            <asp:Parameter Name="TabStripIndex" Type="Int16" /> 
                        </InsertParameters> 
                        <DeleteParameters> 
                            <asp:Parameter Name="CustomerID" Type="String" /> 
                            <asp:Parameter Name="OrderID" Type="String" /> 
                            <asp:Parameter Name="SlideID" Type="String" /> 
                            <asp:Parameter Name="BusinessListingNumber" Type="Int16" /> 
                        </DeleteParameters> 
                        <UpdateParameters> 
                            <asp:Parameter Name="SlideID" Type="String" /> 
                            <asp:Parameter Name="Title" Type="String" /> 
                            <asp:Parameter Name="Description" Type="String" /> 
                            <asp:Parameter Name="ImageData" DbType="Binary" /> 
                            <asp:Parameter Name="ContentType" Type="String" /> 
                            <asp:Parameter Name="FileName" Type="String" /> 
                        </UpdateParameters> 
                    </asp:SqlDataSource> 
                    <div style="text-align: left">  
                        <telerik:RadGrid ID="rgSlides" runat="server" GridLines="None" Skin="Hay" PageSize="8" 
                            ClientSettings-Scrolling-SaveScrollPosition="true" AllowPaging="True" AllowAutomaticUpdates="True" 
                           OnItemCreated="rgSlides_ItemCreated" OnItemDataBound="rgSlides_ItemDataBound" > 
                            <HeaderStyle HorizontalAlign="Left" /> 
                            <ItemStyle HorizontalAlign="Left" /> 
                            <AlternatingItemStyle HorizontalAlign="Left" /> 
                            <ClientSettings EnablePostBackOnRowClick="true">  
                                <Selecting AllowRowSelect="true" /> 
                            </ClientSettings> 
                            <PagerStyle Mode="NumericPages" /> 
                            <MasterTableView PageSize="1" AutoGenerateColumns="False" DataKeyNames="SlideID" 
                                CommandItemDisplay="Top" ShowHeadersWhenNoRecords="true" NoMasterRecordsText="Click New Slide to insert a new slide row." 
                                EditMode="EditForms">  
                                <Columns> 
                                    <telerik:GridButtonColumn CommandName="DeleteRow" CommandArgument="DeleteRow" HeaderText="" 
                                        Text="Delete" UniqueName="DeleteRow">  
                                    </telerik:GridButtonColumn> 
                                    <telerik:GridTemplateColumn UniqueName="ID" SortExpression="ID" ReadOnly="true" Visible="false">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblID" runat="server" Text='<% #Bind("ID") %>' /> 
                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn HeaderText="CustomerID" UniqueName="CustomerID" SortExpression="CustomerID" 
                                        Visible="false">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblCustomerID" runat="server" Text='<%#Bind("CustomerID") %>' /> 
                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn HeaderText="OrderID" UniqueName="OrderID" SortExpression="OrderID" 
                                        Visible="false">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblOrderID" runat="server" Text='<%# Bind("OrderID") %>' /> 
                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn HeaderText="Business Number" UniqueName="BusinessListingNumber" 
                                        SortExpression="BusinessListingNumber">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblBusinessListingNumber" runat="server" Text='<%# Bind("BusinessListingNumber") %>' /> 
                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridBoundColumn DataField="SlideID" DataType="System.Char" HeaderText="SlideID" 
                                        ReadOnly="True" SortExpression="SlideID" UniqueName="SlideID">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridTemplateColumn HeaderText="FileName" UniqueName="FileName" SortExpression="FileName" 
                                        Visible="false">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblFileName" runat="server" Text='<%# Bind("FileName") %>' /> 
                                        </ItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn HeaderText="Title" UniqueName="Title" SortExpression="Title">  
                                        <ItemTemplate> 
                                            <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Title") %>' /> 
                                        </ItemTemplate> 
                                        <EditItemTemplate> 
                                            <asp:TextBox ID="txtTitle" runat="server" Text='<%# Bind("Title") %>' /><br /> 
                                            <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txtTitle" 
                                                ErrorMessage="Please, enter a Title!" Display="Dynamic" SetFocusOnError="true" /> 
                                        </EditItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" SortExpression="Description">  
                                        <ItemTemplate> 
                                            <asp:Label ID="Label1" runat="server" Text='<%# TrimDescription(DirectCast(IIF(Eval("Description") IsNot DBNull.Value,Eval("Description"),string.Empty),String)) %>' /> 
                                        </ItemTemplate> 
                                        <EditItemTemplate> 
                                            <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Description") %>' 
                                                Width="350px" Height="50px" TextMode="MultiLine" /> 
                                        </EditItemTemplate> 
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridBinaryImageColumn DataField="ImageData" HeaderText="Slide" UniqueName="Upload" 
                                        ImageAlign="NotSet" ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit" DataAlternateTextField="Description" 
                                        DataAlternateTextFormatString="Image of {0}">  
                                        <HeaderStyle Width="10%" /> 
                                    </telerik:GridBinaryImageColumn> 
<%--                                      
                                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title" 
                                        UniqueName="Title">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" 
                                        UniqueName="Description">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBinaryImageColumn DataField="ImageData" HeaderText="ImageData" ResizeMode="Fit" 
                                        ImageWidth="100px" ImageHeight="100px" UniqueName="ImageData" />--%> 
                                      
                                    <telerik:GridEditCommandColumn> 
                                    </telerik:GridEditCommandColumn> 
                                </Columns> 
                                <EditFormSettings CaptionFormatString="Update Slide Info for SlideID: {0}" CaptionDataField="SlideID" 
                                    FormCaptionStyle-Font-Bold="true" PopUpSettings-Modal="true" PopUpSettings-Height="250" 
                                    PopUpSettings-Width="450px">  
                                    <EditColumn UniqueName="EditCommandColumn1" ButtonType="PushButton">  
                                    </EditColumn> 
                                    <FormCaptionStyle Font-Bold="True"></FormCaptionStyle> 
                                <PopUpSettings Modal="True" Height="250px" Width="450px"></PopUpSettings> 
                                </EditFormSettings> 
                                <PagerStyle Mode="NextPrev" /> 
                                <CommandItemTemplate> 
                                    <table style="float: left; width: 100%;">  
                                        <tr> 
                                            <td style="text-align: left">  
                                                <asp:Button ID="btnInsertNewRecord" runat="server" CommandName="InsertNewRecord" 
                                                    Text="New Slide" Width="90px" Height="22px" /> 
                                            </td> 
                                            <td style="text-align: right">  
                                                <asp:Button ID="btnRefresh" runat="server" CommandName="Refresh" Text="Refresh" Height="22px" /> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </CommandItemTemplate> 
                            </MasterTableView> 
                        </telerik:RadGrid> 
                    </div> 
                </div> 
                <div style="float: left; width: 100%;">  
                    <table class="TableAddress" style="margin-bottom: 5px;">  
                        <tr> 
                            <td class="TextLeft" colspan="3">  
                                <b>3. Categories:</b> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="TextLeft" colspan="4">  
                                Add categories to each business listing  
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="TextRight" style="width: 80px;">  
                                Categories:  
                            </td> 
                            <td class="TextLeft">  
                                <asp:DropDownList ID="ddlCategory" runat="server" Width="125px" ToolTip="Select Category" 
                                    AutoPostBack="True">  
                                </asp:DropDownList> 
                            </td> 
                            <td class="TextRight" style="width: 110px;">  
                                Sub-Category 1:  
                            </td> 
                            <td class="TextLeft">  
                                <asp:DropDownList ID="ddlSubCategory1" runat="server" Width="125px" ToolTip="Select Sub-Category 1" 
                                    AutoPostBack="True">  
                                </asp:DropDownList> 
                            </td> 
                            <td class="TextRight" style="width: 110px;">  
                                Sub-category 2:  
                            </td> 
                            <td class="TextLeft">  
                                <asp:DropDownList ID="ddlSubCategory2" runat="server" Width="125px" ToolTip="Select Sub-Category 2">  
                                </asp:DropDownList> 
                            </td> 
                        </tr> 
                    </table> 
                    <br /> 
                    <div style="float: left; margin-left: 10px; margin-bottom: 10px; margin-top: 10px;">  
                        <asp:Label ID="lblDuplicateCategory" runat="server" ForeColor="Red"></asp:Label> 
                    </div> 
                    <br /> 
                    <div class="controlsdiv">  
                        <telerik:RadGrid ID="rgCategory" runat="server" GridLines="None" Skin="Sunset" PageSize="8" 
                            ClientSettings-Scrolling-SaveScrollPosition="true" AllowPaging="True">  
                            <HeaderStyle HorizontalAlign="Left" /> 
                            <ItemStyle HorizontalAlign="Left" /> 
                            <AlternatingItemStyle HorizontalAlign="Left" /> 
                            <ClientSettings EnablePostBackOnRowClick="true">  
                                <Selecting AllowRowSelect="true" /> 
                            </ClientSettings> 
                            <PagerStyle Mode="NumericPages" /> 
                            <MasterTableView PageSize="5" AutoGenerateColumns="False" DataKeyNames="ID" CommandItemDisplay="Top" 
                                ShowHeadersWhenNoRecords="true" NoMasterRecordsText="Select Business Listing to Save Category.">  
                                <Columns> 
                                    <telerik:GridButtonColumn CommandName="DeleteRow" CommandArgument="DeleteRow" HeaderText="" 
                                        Text="Delete" UniqueName="DeleteRow">  
                                    </telerik:GridButtonColumn> 
                                    <telerik:GridBoundColumn DataField="ID" DefaultInsertValue="" HeaderText="ID" SortExpression="ID" 
                                        UniqueName="ID" DataType="System.Int16" ReadOnly="True" Visible="false">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="OrderID" DefaultInsertValue="" HeaderText="OrderID" 
                                        SortExpression="OrderID" UniqueName="OrderID">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="BusinessListingNumber" DataType="System.Int16" 
                                        DefaultInsertValue="" HeaderText="Business Number" SortExpression="BusinessListingNumber" 
                                        UniqueName="BusinessListingNumber">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="MainCategory" DefaultInsertValue="" HeaderText="Category" 
                                        SortExpression="MainCategory" UniqueName="MainCategory">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="SubCategory1" DefaultInsertValue="" HeaderText="Sub-Category 1" 
                                        SortExpression="SubCategory1" UniqueName="SubCategory1">  
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="SubCategory2" DefaultInsertValue="" HeaderText="Sub-Category 2" 
                                        SortExpression="SubCategory2" UniqueName="SubCategory2">  
                                    </telerik:GridBoundColumn> 
                                </Columns> 
                                <PagerStyle Mode="NextPrev" /> 
                                <CommandItemTemplate> 
                                    <table style="float: left; width: 100%;">  
                                        <tr> 
                                            <td style="text-align: left">  
                                                <asp:Button ID="btnSaveCategory" runat="server" CommandName="SaveCategory" Text="Save Category" 
                                                    Width="105px" Height="25px" /> 
                                            </td> 
                                            <td style="text-align: right">  
                                                <asp:Button ID="btnRefresh" runat="server" CommandName="Refresh" Text="Refresh" Height="25px" /> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </CommandItemTemplate> 
                            </MasterTableView> 
                        </telerik:RadGrid> 
                        <asp:SqlDataSource ID="dsCategory" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
                            SelectCommand="admin_Customers_BusinessListings_Categories_Select" SelectCommandType="StoredProcedure" 
                            InsertCommand="admin_Customers_BusinessListings_Categories_Insert" InsertCommandType="StoredProcedure" 
                            DeleteCommand="admin_Customers_BusinessListings_Categories_DeleteRow" DeleteCommandType="StoredProcedure">  
                            <SelectParameters> 
                                <asp:Parameter Name="OrderID" Type="String" /> 
                                <asp:Parameter Name="BusinessListingNumber" Type="Int32" /> 
                                <asp:Parameter Name="TabStripSelectedIndex" Type="Int32" /> 
                            </SelectParameters> 
                            <InsertParameters> 
                                <asp:Parameter Name="OrderID" Type="String" /> 
                                <asp:Parameter Name="BusinessListingNumber" Type="Int32" /> 
                                <asp:Parameter Name="TabStripSelectedIndex" Type="Int32" /> 
                                <asp:Parameter Name="MainCategory" Type="String" /> 
                                <asp:Parameter Name="SubCategory1" Type="String" /> 
                                <asp:Parameter Name="SubCategory2" Type="String" /> 
                            </InsertParameters> 
                            <DeleteParameters> 
                                <asp:Parameter Name="ID" Type="Int32" /> 
                                <asp:Parameter Name="OrderID" Type="String" /> 
                                <asp:Parameter Name="BusinessListingNumber" Type="Int32" /> 
                                <asp:Parameter Name="TabStripSelectedIndex" Type="Int32" /> 
                            </DeleteParameters> 
                        </asp:SqlDataSource> 
                    </div> 
                </div> 
                
            </telerik:RadAjaxPanel> 
        </div> 
    </div> 
</asp:Content> 
 
 

Code behind for displaying images

    Protected Sub rgListingWithImages_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgListingWithImages.ItemCommand  
        'Check which command name was selected  
        Select Case e.CommandName  
            Case "InsertNewRecord"  
                'Before inserting a new business listing check the strip index  
                If RadTabStripListings.SelectedIndex = 0 Then  
                    'Check if the OrderID exists  
                    If Not Me.OrderID = String.Empty Then  
                        'If OrderID exists then insert a new row into the BusinessListings table  
                        'Set all the boolean values in db to false in the stored procedure  
                        dsBusinessListings.InsertParameters("CustomerID").DefaultValue = Me.CustomerID  
                        dsBusinessListings.InsertParameters("OrderID").DefaultValue = Me.OrderID  
                        dsBusinessListings.InsertParameters("TabStripSelectedIndex").DefaultValue = RadTabStripListings.SelectedIndex  
                        'Get the Business Listing Description  
                        Dim BLD As New BusinessListingsPlanAndPricing  
                        dsBusinessListings.InsertParameters("BusinessListingDescription").DefaultValue = BLD.GetBusinessListingDescritpion(RadTabStripListings.SelectedIndex)  
                        dsBusinessListings.InsertParameters("WithSlideNoSlide").DefaultValue = "WS" 
                        'Call the Insert method  
                        dsBusinessListings.Insert()  
                        'Get data for the grid  
                        SelectGridWithImages()  
                        'Refresh the grid  
                        rgListingWithImages.Rebind()  
 
                        'Display and update pricing  
                        DisplayPricing()  
                    End If  
                End If  
 
                'Clear/Reset Contact Info, Display, About Business, Business Hours controls  
                ClearTextContactInformation()  
                ClearTextDisplayinformation()  
                ClearTextAboutBusinessInformation()  
                ClearTextBusinessHoursInformation()  
                Exit Select  
            Case "SaveData"  
                'Save/Update Business and Contact information etc.  
                SaveBusinessData()  
 
                'Call update method  
                dsBusinessInfo.Update()  
                Exit Select  
            Case "Preview"  
                'Get required parameters to preview selected business listing  
                Dim myItem As GridDataItem = DirectCast(e.Item, GridDataItem)  
                Dim CustID As String = myItem("CustomerID").Text  
                Dim OrdID As String = myItem("OrderID").Text  
                Dim ListNo As String = myItem("BusinessListingNumber").Text  
                Dim withSlidenoSlide As String = "WS" 
                Dim TabStripIndex As String = RadTabStripListings.SelectedIndex.ToString  
 
                'Inst. encryption string class  
                Dim QSE As New QueryStringEncryption  
 
                'Pass on new customers CustID, CategoryID and business number to the preview page  
                Dim BaseURL As String = "previewlisting.aspx?" 
                BaseURL &= "&custid=" & QSE.Encryt(Me.CustomerID)  
                BaseURL &= "&ordid=" & QSE.Encryt(OrderID)  
                BaseURL &= "&busnum=" & QSE.Encryt(ListNo)  
                BaseURL &= "&index=" & QSE.Encryt(WithSlideNoSlide)  
                BaseURL &= "&tabind=" & QSE.Encryt(RadTabStripListings.SelectedIndex.ToString)  
 
                'Add quote marks at front & end of query string for javascript code  
                Dim TargetURL As String = "'" & BaseURL & "'"  
 
                'Open the pop up window with required query string parameters  
                OpenJScriptPopUpWindow(BaseURL)  
                Exit Select  
        End Select  
    End Sub  
 

 

 

Here is the issue:

Grid one (rgListings) has a Preview link in one of the columns which I use to open a new window through some javascript which is in a file on my project. When I add a listing into this grid and I click on the Preview link in the row the window pops open no problem.

But when I add a listing in the rgListings grid and then add an image in the second (rgSlides) grid that is where it comes to a halt. When I click on the Preview link in the rgListings grid to open the pop up window I get an object not found error and I do not know where to look. I think that I have pin pointed it to this javascript on in the markup, but I am not sure.

I think this is where the error is comming from, but not sure:

 

            function conditionalPostback(sender, eventArgs) {  
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");  
                if (eventArgs.get_eventTarget().match(theRegexp)) {  
                    var upload = $find(window['UploadId']);  
 
                    //AJAX is disabled only if file is selected for upload  
                    if (upload.getFileInputs()[0].value != "") {  
                        eventArgs.set_enableAjax(false);  
                    }  
                }  
            }  
 
            function validateRadUpload(source, e) {  
                e.IsValid = false;  
 
                var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);  
                var inputs = upload.getFileInputs();  
                for (var i = 0; i < inputs.length; i++) {  
                    //check for empty string or invalid extension  
                    if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {  
                        e.IsValid = true;  
                        break;  
                    }  
                }  
            } 

 

I have tried putting some jscript on the page to open the window with the btnPreview.Add.Attributes(“onclick”,  “showForm();”) which does open the pop up window but I still get that object not found error and 2 windows open. I also added a button in the grid in the item template and called the jscript window open using the OnClientClick which opens the window but I still get the object not found.

 

  Object expected  pricingoptions.aspx?un=AhXmBz0EmheYEWJuqM3wmw%3d%3d&cid=TcOtbnnIOsxq1CXOjfwSOw%3d%3d&bn=7XKB52RyE53nj0aY1w19usl3BDx+Or5DpGp+x+Z7g+E%3d, line 3 character 4

 

Hopefully some extra eyes might see my problem.

 

Thanks

Chom

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 01 Apr 2010, 06:58 AM
Hello Chom,

I checked your code however I could not fine the source of the problem there.
Could you please try opening a formal support ticket and send us a runnable sample there? We will debug it locally and thus try finding what could have gone wrong.

Thank you for your cooperation in advance.
Regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Chom
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or