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

Default Button

1 Answer 74 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Patric Svensson
Top achievements
Rank 1
Patric Svensson asked on 14 Feb 2013, 11:15 AM
Hi, when i press enter in the Textbox (input), I wan't the default button (in the Panel) to hit, so I jump in to the "SearchOnClick" method on enter press, but i can't get it to work. When i press enter nothing happens. How can i solve this?

<asp:Panel runat="server" ID="SearchPanel" DefaultButton="BtnSearch" CssClass="search-box">
    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox2" AllowCustomEntry="true" TextSettings-SelectionMode="Single"
        OnClientDropDownOpened="GUI.AutoCompletedOpened" OnClientRequestFailed="GUI.SearchRequestFailed"
        OnClientTextChanged="GUI.SearchInputChanged" InputType="Text" Filter="StartsWith" Width="180px" DropDownWidth="300px" 
        CssClass="telerik-search"  EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" OnEntryAdded="Search_Entry">
        <WebServiceSettings Path="~/Views/Search/SearchResult.aspx" Method="GetSearchResult"></WebServiceSettings>
        <ClientDropDownItemTemplate>
                <div style="display: #= Attributes.DisplayMode #">
                    <a href="#= Attributes.ProductUrl #">
                        <span class="image-holder">
                            <img src="#= Attributes.ImageUrl # " alt=" #= Text # " width="50" height="50" />
                        </span>
                        #= Text # <br />
                        <span>#= Attributes.Identifier #</span>
                    </a>
                    #= Attributes.SearchUrl #
                </div>
        </ClientDropDownItemTemplate>
    </telerik:RadAutoCompleteBox>
    <asp:HiddenField runat="server" ID="hSearchValue" ClientIDMode="Static" />
    <asp:Button id="BtnSearch" runat="server" OnClick="SearchOnClick" CssClass="search"  />
</asp:Panel>

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 19 Feb 2013, 12:55 PM
Hello Patric,

I would suggest that you try using our new RadSearchBox control that you can find very useful in the scenario that you are trying to achieve. Here, you can also refer to the on-line documentation of the control.

All the best,
Kate
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.
Tags
AutoCompleteBox
Asked by
Patric Svensson
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or