Use RadWindow like jquery dialog?

4 posts, 1 answers
  1. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 12 Dec 2012 Link to this post

    On my master page I have a DIV that is used to return a list of results when  a user uses our generic search function at the top of all the pages in our site.  I am currently using jquery dialog to make the Search Result DIV look and act like a window.  While this works great, it is a departure from the look and feel from the rest of the site because it is not styled like Telerik controls...

    Is there a means to do a similar ability in Telerik asp.net ajax? 

    In my code I have something like this:
    function OpenSearchInfo() {
                var search = $("#RadTextBoxTag").val();
      
                if (search.length < 3) {
                    alert("A minimum of three characters is required for Search.");
                    return false;
                }
      
                $("#SearchResults").show();
                $("#SearchResults").dialog({
                    title:"Results",
                    height: 300, width: 500,
                    position: ['middle', 40],
                    close: function() {
                          $find("<%= RadTextBoxTag.ClientID %>").clear();
                    }
      
                });


    The panel and Div
      <asp:Panel ID="PanelFindTag" runat="server" DefaultButton="ImageButtonSearch">
                        <div class="FindTag">
                            <table>
                                <tr>
                                    <td>
                                        <telerik:RadTextBox ID="RadTextBoxTag" runat="server" EmptyMessage="Tag / Serial Search"
                                            ClientIDMode="Static" />
                                        <div id="SearchResults">
                                            <div id="innerSearchResults">
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="ImageButtonSearch" AlternateText="Tag / Serial Search" ToolTip="Tag / Serial Search"
                                            runat="server" OnClientClick="OpenSearchInfo();return false;" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </asp:Panel>
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 12 Dec 2012 Link to this post

    Hello Warren,

    I think the control you're trying to replicate is the RadComboBox with LoadOnDemand. If you want it to look like a textbox, you can just set ShowToggleImage="false".

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 12 Dec 2012 Link to this post

    I am trying to open the DIV as a modal...  nothing really to do with a combo box...
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 13 Dec 2012 Link to this post

    Hello Warren,

    You can place the panel in a RadWindow's ContentTemplate and show() the RadWindow. This demo shows how to use this mode of the control: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx. The client-side API of the control allows you to control its title, size and position if you do not want to declare them in the markup: http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html. The OnClientClose event we expose can be used to execute code after the popup is closed: http://demos.telerik.com/aspnet-ajax/window/examples/clientsideevents/defaultcs.aspx?product=window.


    Regards,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top