LoadControl and Dock LoadDockLayout Event Not firing

10 posts, 1 answers
  1. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 30 Jun 2011 Link to this post

    Hi,

       I placed the rad dock on a user control and that user control is loaded at run time using Page.LoadControl("controlfile.ascx"). Everything works fine but RadDocLayout.LoadDockLayout event is not firing for some reason.
        I have several panesl in the dock like code below.

    <telerik:RadDockLayout runat="server" ID="docLayoutPanels">
        <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="370" MinHeight="200"
            Style="float: left; margin-right: 15px">
            <telerik:RadDock ID="dockImages" runat="server" Title="Image Manager (Image bridge)"
                UniqueName="Images">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadBinaryImage ID="imgPreview1" runat="server" ImageUrl="~/images/NoImageAvailable.gif"
                                    Width="150" Height="150" ResizeMode="Fit" />
                            </td>
                            <td>
                                <telerik:RadBinaryImage ID="imgPreview2" runat="server" ImageUrl="~/images/NoImageAvailable.gif"
                                    Width="150" Height="150" ResizeMode="Fit" />
                            </td>
                            <td>
                                <asp:HyperLink ID="hypViewALL" runat="server" Text="View All"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="docSalesChannels" runat="server" Title="Sales Channels" UniqueName="SalesChannels">
                <ContentTemplate>
                    <telerik:RadGrid ID="grdSalesChannels" runat="server" GridLines="None" AllowPaging="True">
                        <ExportSettings>
                            <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                        </ExportSettings>
                        <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                            <RowIndicatorColumn Visible="False">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="False" Resizable="False">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Channel" UniqueName="TemplateColumn">
                                    <ItemTemplate>
                                        <asp:Label ID="lblChannel" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Enabled" UniqueName="TemplateColumn">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkEnabled" runat="server" Enabled="false" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Price" SortExpression="">
                                    <ItemTemplate>
                                        <asp:Label ID="lblChannelPrice" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Shipping">
                                    <ItemTemplate>
                                        <asp:Label ID="lblShipping" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                        </MasterTableView>
                    </telerik:RadGrid>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockKits" runat="server" Title="Kits" UniqueName="Kits">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdKits" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="SKU" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypKitItemId" runat="server" Text='<%# Eval("ChildProductId") %>'
                                                        NavigateUrl='<%# "~/Inventory/Product.aspx?ID=" &  Eval("ChildProductId") %>'></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Qty" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("Qty")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypManageKits" runat="server" Text="Manage Kit"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockKitsRelated" runat="server" Title="Related Kits" UniqueName="RelatedKits">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdKitsRelated" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="SKU" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypKitItemId" runat="server" Text='<%# Eval("ID") %>' NavigateUrl='<%# "~/Inventory/Product.aspx?ID=" &  Eval("ID") %>'></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Product Name" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("ProductName")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypManageRelatedKits" runat="server" Text="Manage Related Kits"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="docShadows" runat="server" Title="Shadows" UniqueName="Shadows">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdShadows" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="SKU" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypShadowID" runat="server" Text='<%# Eval("ID") %>' NavigateUrl='<%# "~/Inventory/Product.aspx?ID=" &  Eval("ID") %>'></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Company" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypCompanyID" runat="server"></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypManageShadows" runat="server" Text="Manage Shadows"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="docPurchaseOrders" runat="server" Title="Purchase Orders" UniqueName="PurchaseOrders">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdPuchaseOrders" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="PO#" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypPONumber" runat="server" Text='<%# Eval("ID") %>' NavigateUrl='<%# "~/Purchasing/PurchaseOrder.aspx?merchantid=" & Eval("CompanyID") & "&orderid=" &  Eval("ID") %>'></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Date" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#CDate(Eval("DateOrdered")).ToShortDateString()%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Qty" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("QtyOrdered")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Unit Price" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#FormatCurrency(Eval("UnitPrice"), 2)%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Discount" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblDiscount" runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Adj. Unit Price" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#FormatCurrency(Eval("AdjustedPrice"), 2)%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Vendor" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypVendor" runat="server" Text='<%# Eval("DisplayName") %>' NavigateUrl='<%# "~/Settings/Vendor.aspx?id=" & Eval("VendorID") & "&MerchantID=" &  Eval("CompanyID") %>'></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypAddNewPO" runat="server" Text="Add to Purchase"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="docInventoryTransfer" runat="server" Title="Inventory Transfers"
                UniqueName="InventoryTransfer">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdInventoryTransfer" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Adjusted On" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#CDate(Eval("AdjustedOn")).ToString("MM/dd/yyyy hh:mm tt")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Adjusted By" UniqueName="TemplateColumn"
                                                Visible="false">
                                                <ItemTemplate>
                                                    <asp:HyperLink ID="hypAdjustedBy" runat="server"></asp:HyperLink>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Qty before Adj." UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("InventoryBeforeAdjustment")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Qty Adjusted" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("Quantity")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Reason" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("Reason")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="" UniqueName="DeleteColumn" Visible="false">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" CommandName="Delete"
                                                        CommandArgument='<%# eval("ID") %>' OnClientClick="return confirm('Are you sure you want to delete this adjustment?')"></asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypNewAdjustment" runat="server" Text="Adjust Inventory"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockCustomColumns" runat="server" Title="Custom Columns" UniqueName="CustomColumns">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdCustomColumns" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="ColumnName" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblColName" runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Value" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblValue" runat="server"></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                                <asp:HyperLink ID="hypSelectCustomColumns" Visible="false" Text="Choose Custom Columns"
                                    runat="server" NavigateUrl="~/Settings/ProductSummaryPanels.aspx"></asp:HyperLink>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypCustomColumns" runat="server" Text="Manage Custom Columns"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockNotes" runat="server" Title="Notes" UniqueName="Notes">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdNotes" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Note" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%# Eval("Note") %>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypAddNewProductNote" runat="server" Text="Add Note"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="docPurchaseDetails" runat="server" Title="Purchasing Details"
                UniqueName="PurchaseDetails">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td>
                                            Default Vendor:
                                        </td>
                                        <td>
                                            <asp:HyperLink ID="hypPurchaseDetailDefaultvendor" runat="server"></asp:HyperLink>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Vendor SKU:
                                        </td>
                                        <td>
                                            <asp:Label ID="lblPurchaseDetailVendorSKU" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Last Cost:
                                        </td>
                                        <td>
                                            <asp:Label ID="lblPurchaseDetailLastCost" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            DropShip Mode:
                                        </td>
                                        <td>
                                            <asp:Label ID="lblPurchaseDetailDropShipMode" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypViewPurchaseDetails" runat="server" Text="View Purchasing Details"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockVendorPrices" runat="server" Title="Vendor Prices" UniqueName="VendorPrices">
                <ContentTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <telerik:RadGrid ID="grdVendorPrices" runat="server" GridLines="None" AllowPaging="True">
                                    <ExportSettings>
                                        <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin=""
                                            PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf>
                                    </ExportSettings>
                                    <MasterTableView AutoGenerateColumns="False" AllowSorting="True" PageSize="50">
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Visible="False" Resizable="False">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Vendor" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("DisplayName")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Vendor SKU" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#Eval("VendorSKU")%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Price" UniqueName="TemplateColumn">
                                                <ItemTemplate>
                                                    <%#FormatCurrency(Eval("Price"), 2)%>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="hypViewAllVendorPrices" runat="server" Text="View All"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockWareHouses" runat="server" Title="Warehouses" UniqueName="WareHouses">
                <ContentTemplate>
                    <uc1:product_warehouseinventory id="Product_WarehouseInventory1" showoffsetqtycolum="false"
                        runat="server" />
                </ContentTemplate>
            </telerik:RadDock>
        </telerik:RadDockZone>
    </telerik:RadDockLayout>

    Weird thing is that the events for the grid (like NeedDataSource) fires correctly and grid get bind. But LoadDockLayout is not firing so I can't load state/positions of the panels from database.
       Is there anything I can do to make sure event is firing?
       Thanks,
       Sameers
  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 04 Jul 2011 Link to this post

    Hello Sameers,

    It is possible that you add the user control with the RadDocks too late in the page Lifecycle. It is recommended to add RadDock controls before RadDockLayout.LoadDockLayout event so that their position is loaded properly. Usually, the best place is Page.Init.  You can refer to this RadDock Lifecycle documentation article.
    protected void Page_Init(object sender, EventArgs e)
    {
        DocksControl customControl = (DocksControl)Page.LoadControl("DocksControl.ascx");
        DocksPlaceHolder.Controls.Add(customControl);
    }

    I have attached a sample project that recreates the described scenario as a reference. For the purpose of demonstration I have used cookie as a storage for RadDocks position.

    You can also examine the articles for SaveDockLayout and LoadDockLayout for more information about the events.

    If you are still unable to resolve your problems please prepare and send us a sample, runnable project that isolates your case so that we can examine it locally and pinpoint the cause.

    Greetings,
    Slav
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 04 Jul 2011 Link to this post

    Hi,

       Thanks for the reply. I think if I provide a little further information that maybe helpful. I forgot to add them before.

        I encapsulated the User control of the panels within asp:UpdatePanel. Once page is loaded, I simulated the click of a button to load panels. So, that means, when the page is first time loaded, panels are NOT loaded. That is correted, I wanted that way. Once page is fully loaded, a JavaScript is called to execute the Event refernece of the a button which in turns, display the panels.

       So, here is the code to load the panels.
    Private Sub btnLoadControl_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLoadControl.Click
     
        Try
               Dim ctrl As Control = Nothing
            ctrl = Me.LoadControl("~/Controls/Product_Dashboard_Panels.ascx")
            ctrl.ID = "Product_Dashboard_Panels1"
            CType(ctrl, Product_Dashboard_Panels).LoadDetails()
            pnlPanels.Controls.Clear()
            pnlPanels.Controls.Add(ctrl)
     
        Catch ex As Exception
            msg.ShowError("Failed to load control. " & ex.Message)
        End Try
    End Sub

    Do you think the events are NOT fired just because of this that I am loading Control dynamically and then adding to the page? Also, note the code on the PAGE_LOAD.

    If Page.IsPostBack Then
        'On Postback, we need to load controls immediately, otherwise, we may loose the viewstate.
        btnLoadControl_Click(Nothing, Nothing)
    Else
        ScriptManager.RegisterStartupScript(Page, Me.GetType, "rightPabels", Page.ClientScript.GetPostBackEventReference(btnLoadControl, "") & ";", True)
    End If


      I think that can  help to identify the issue. Please let me know, otherwise, I can try to prepare a sample solution for this.

     thanks,
      Sameers
  5. Answer
    Slav
    Admin
    Slav avatar
    1355 posts

    Posted 05 Jul 2011 Link to this post

    Hello Sameers,

    My suggestion is to insert static user control, as it is always present on the page anyway. That way you won't experience issues with loading the RadDocks on the correct position.

    If you want to add the user control in code-behind, you must do so in any of the events that take place before LoadDockLayout. The Page.Init event is perfect for this purpose as it is fired prior to LoadDockLayout.

    Please examine the sample project I have attached and this short video, to gain a better understanding of the difference. Main.aspx uses static user control and Default.aspx has programmatically added user control.

    You can also take a look at this live demo, in which Page.Init is also used for loading RadDocks.

    Greetings,
    Slav
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 13 Jul 2011 Link to this post

    You are right, I placed the control on the page and hide that and after page has been loaded completed and visible to the user, then I started loaded contents of the user control having dock panels.

    It works fine now.

    I just wonder, does telerik has any control/machanism for the "Lazy Load" technique? Just like the codeproject article http://www.codeproject.com/KB/ajax/PartialUpdatePanel.aspx

       The above mentioned control works fine, but the only problem is it doesn't work with telerik :) Does telerik provide such a control so that we can partially load page content, on demand? 

        thanks,
        Sameers
  7. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 14 Jul 2011 Link to this post

    Hi Sameers,

    I am glad that the provided solution helped you with your problem.

    Thank you for sharing the article with the "Lazy Load" technique, it shows interesting approach for real asynchronous loading of partial content. Currently we do not have control, which implements the described mechanism. Also we don't provide support for third-party controls and any unexpected behavior, caused by the presence of such controls, is not tested.

    Regards,
    Slav
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  8. Sameers
    Sameers avatar
    63 posts
    Member since:
    Oct 2004

    Posted 14 Jul 2011 Link to this post

    Thanks Slav,

        I didn't meant to get any support on that article. Just wanted to know if there is any existing control for such functionality available in telerik or telerik ever planned it for the future?  Its sometime very critical to do "lazy loading" of contents of the page. But due to lack of some proper framework, it becomes very hard.

        At the same time, I see most of the techniques used are done using a post back, I wonder if telerik can introduce a framework where such functionality can be achieved "without postback" so that it is "real" partial loading of the pages. Just a suggestion.

         Thanks again,
         Sameers
  9. Daniel
    Daniel avatar
    16 posts
    Member since:
    Oct 2007

    Posted 15 Aug 2011 Link to this post

    I would also be interested to know if Telerik is going to implement this kind of functionality. The PartialUpdatePanel is delivering great functionality for our portal page and I consider skipping Telerik for this one, until it gets some support for this.

    Daniel
  10. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 17 Aug 2011 Link to this post

    Hi Daniel,

    Thank you again for the suggested functionality. The feature is now logged in the PITS, so you can check it by following this link: Public URL. Its implementation will be considered for any of the future releases of the RadControls for ASP.NET AJAX, although I cannot provide a firm estimate when it will be available.

    Kind regards,
    Slav
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  11. Daniel
    Daniel avatar
    16 posts
    Member since:
    Oct 2007

    Posted 17 Aug 2011 Link to this post

    Hi Slav,

    thanks for the reply. I'll keep an eye on PITS. It has my vote.

    For the time being I implemented a dual-mode approach: I use the PartialUpdatePanel together with RadDock to build a dynamic portal page, but without the ability to configure the page. Configuration (drag/drop and add/delete dynamic content) is handled by a 2nd view-mode of the page, but in that case no content is actually loaded in the RadDock windows. Switching mode is handled by a button that initiates a postback. The entire page will be rendered again.
     
    Although this is working I prefer a simpler UI by allowing this functionality in one mode.

    Regards,

    Daniel
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017