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

RadSearchbox

3 Answers 340 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Pravallika
Top achievements
Rank 1
Pravallika asked on 13 Jun 2014, 12:39 PM
Hai,

i got one problem in radsearcchbox when i select any item in search box OnSearch event will rise and some dropdowns will bind based on Radsearchbox item now i got one problem when i remove that item in Radsearchbox i want to remove all the items in dropdowns 
<cc1:RadSearchBox  runat="server" ID="cmbItemMaster" OnClientDataRequesting="OnClientSearch"
                                       OnSearch="cmbItemMaster_Search" Skin="WebBlue" Style="padding-right: 5px; padding-left: 5px; font-family: Calibri;"
                                               Width="85%" AutoPostBack="true" ZIndex="10000000" DropDownSettings-Width="200px" DropDownSettings-Height="200px">
                                           </cc1:RadSearchBox>
protected void cmbItemMaster_Search(object sender, SearchBoxEventArgs e)
        {
          
                ddlMaterialCode.Items.Clear();
                LoadMaterialCodes(e.Value);
               
            }


when i remove the selected item in radsearchbox the ddlMaterialCode will not show means the dropdown items of ddlMaterialCode is empty and after seleccting radsearchbox item then only it will bind how to do it sir

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 17 Jun 2014, 01:45 PM
Hello,

In this case I would suggest using the jQuery keyup event for the RadSearchBox input element and perform some logic once the text value of this element is empty. This means that the user has deleted the selected item text from the input field.
//JavaScript
function pageLoad() {
    $telerik.$(".rsbInput ").keyup(function () {
        //your logic for clearing the drop down items goes here
    });
}


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
segolene
Top achievements
Rank 1
answered on 12 Sep 2016, 02:59 PM

Hello !

I use a RadSearchBox like this : http://demos.telerik.com/aspnet-ajax/searchbox/examples/overview/defaultcs.aspx.

And I search to have my result in First or a "auto-scroll" to go to my result.

I tried with onFocus and this code :  var typeSearchBox = $find("<%= RadSearchBox1.ClientID %>");
                                                          typeSearchBox = typeSearchBox.get_inputElement();
                                                           typeSearchBox.focus();

 

But I don't arrive. Do you have a idea ?

0
Peter Milchev
Telerik team
answered on 15 Sep 2016, 08:09 AM
Hello Segolene,

There is already an answer to your question in your other thread: RadSearchBox and scrolling to go to the result. I would like to suggest you to continue the discussion there to avoid any duplication. 

In general, for questions that are not related to the thread's original topic and scenario, we recommend opening a new thread. This will facilitate a tidier support history of your account and better support service.

Regards,
Peter Milchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
SearchBox
Asked by
Pravallika
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
segolene
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or