Completed
Last Updated: 28 Dec 2023 14:08 by ADMIN
Created by: Nick
Comments: 1
Category: SearchBox
Type: Feature Request
0

I want to be able to let a user choose "Landlords", "Tenants", "Owners" and search for a name. The data for the search box comes from different tables.

<asp:SqlDataSource ID="SqlDataSourceTenants" runat="server"

                           ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                           SelectCommand="SELECT Id,TenantEntityName as EntityName FROM TenantEntities"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceLandlords" runat="server"
                           ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                           SelectCommand="SELECT Id, LandlordEntityName as EntityName FROM LandlordEntities"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceOwners" runat="server"
                           ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>"
                           SelectCommand="SELECT Id,OwnerEntityName As EntityName FROM OwnerEntities"></asp:SqlDataSource> 

I would like to set the DatasourceId on the RadSearchBox to one of the above when the SearchContext changes. I have worked out how to get the selected searchcontext text via an Ajax Request.

     function OnClientLoad(sender, args) {
                    var context = sender.get_searchContext();
                    var $ = $telerik.$;
                    $(context).on({
                        "selectedIndexChanged": function (event) {
                            var searchbox = $find("<%=RadSearchBox1.ClientID%>");

                // this is the search context dropdown selectedIndexChanged event handler 
                            var ajaxManager = $find("<%=RadAjaxManager1.ClientID%>");
                            ajaxManager.ajaxRequest(context.get_selectedItem().get_text());
            }
        });
                }

 

I cannot work out how to change the datasource at runtime (I get datasource not found when I run the following code).

    Protected Sub RadAjaxManager1_OnAjaxRequest(sender As Object, e As AjaxRequestEventArgs)
        if not isnothing(radsearchbox1.datasource)
            select Case e.Argument
                Case "Tenants"
                    RadSearchBox1.DataSource = sqldatasourcetenants
                    RadSearchBox1.databind
                Case "Landlords"
                    RadSearchBox1.DataSource = sqldatasourcelandlords
                    RadSearchBox1.databind
                Case "Owners"
                    RadSearchBox1.DataSource = sqldatasourceowners
                    RadSearchBox1.databind
            End Select
        End If
    End Sub

In the OnSearch Event I just need to get the type of entity (which I could get from checking the Id of the bound datasource) and the Id of the entity:

Protected Sub RadSearchBox1_OnSearch(sender As Object, e As SearchBoxEventArgs)
        If e.DataItem IsNot Nothing Then
            Dim dataItem = DirectCast(e.DataItem, Dictionary(Of String, Object))
            Dim thisId As String = dataItem("Id").ToString()
            Dim thisEntityName As String = dataItem("EntityName").ToString()
            ' Lookup in database and redirect to the relevant data view / edit page
        End If
    End Sub

 

Surely this is a common request and deserves consideration?

 

Completed
Last Updated: 14 Jan 2022 12:41 by ADMIN
Release R1 2022
Created by: Scott
Comments: 0
Category: SearchBox
Type: Bug Report
0

We are having a touchscreen problem with the RadSearchBox, specifically on the MicroSoft surface touchscreen. I have tested this out on mobile phone and other tablets, but the problem occurs on the Surface.

The issue is that you cannot change the SearchContext, because it never seems to recognize the touch event.

 

You can touch the SearchContext to initiate the drop-down event, but then it is impossible to select an item from the list.

There are no other problems with Telerik controls on the Surface (the touch events on RadDropDown, RadTabStrip, RadComboBox, RadMenu, etc.) all seem to be working fine.

Completed
Last Updated: 15 Feb 2021 11:43 by ADMIN
Created by: n/a
Comments: 2
Category: SearchBox
Type: Feature Request
0

Perhaps a simple feature to permit high speed searches in RadSearch is to allow custom SQL Select strings in lieu of direct connect to a SQL Datasource (unless there is a way to accomplish the following in a SQL Datasource)

I have FreeText and text optimization configured/added in SQL Server.  This provides a tremendous speed boost for searching strings.  Therefore, somehow in the RadSearch box allow searches such as:

SELECT * FROM myTable WHERE contains(myTextIndexedColumn,'this is fast') 

SELECT * FROM myTable WHERE FreeText(myTextIndexedColumn,'this is so much faster!') 

Completed
Last Updated: 07 Oct 2019 12:18 by ADMIN
Created by: Thomas
Comments: 1
Category: SearchBox
Type: Bug Report
0
The Tooltip property of the SearchBoxButton in the Buttons collection of the RadSearchBox is not rendered on the button element client-side.
Completed
Last Updated: 09 Jul 2018 12:48 by ADMIN
A workaround is to disable the embedded jQuery and use an older version (for example, 1.11.1 which is the previous version the suite used): https://docs.telerik.com/devtools/aspnet-ajax/controls/scriptmanager/disabling-the-embedded-jquery

Repro steps:

- Put a searchbox on the page with some data source
- Hook its postback handler, OnSearch
- search something in it, select the item to postback

expected: search fired

actual: JS error in FF


        <telerik:RadSearchBox RenderMode="Lightweight" runat="server" ID="RadSearchBox1"
            DataTextField="Name"
            DataValueField="id"
            OnSearch="RadSearchBox1_Search">
        </telerik:RadSearchBox>


    protected void Page_Load(object sender, EventArgs e)
    {
        RadSearchBox1.DataSource = GetData();
        RadSearchBox1.DataBind();
    }
    protected DataTable GetData()
    {
        DataTable tbl = new DataTable();
        tbl.Columns.Add(new DataColumn("id", typeof(decimal)));
        tbl.Columns.Add(new DataColumn("Name", typeof(string)));
        tbl.Columns.Add(new DataColumn("Reason", typeof(string)));
        tbl.Columns.Add(new DataColumn("someField", typeof(decimal)));
        tbl.Columns.Add(new DataColumn("anotherField", typeof(string)));
        tbl.Rows.Add(new object[] { 1, "one", "fi\\nrst", 2, "5" });
        tbl.Rows.Add(new object[] { 2, "two", @"se\ncond", 3, null/*SIMULATE EMPTY VALUE*/ });
        tbl.Rows.Add(new object[] { 3, "three", "third", 4, "5" });
        tbl.Rows.Add(new object[] { 4, "four", "fourth", 5, "5" });

        return tbl;
    }

    protected void RadSearchBox1_Search(object sender, SearchBoxEventArgs e)
    {
        Response.Write(DateTime.Now.ToString());
    }
Completed
Last Updated: 27 May 2021 08:30 by ADMIN
Created by: SALVATORE
Comments: 1
Category: SearchBox
Type: Feature Request
0
Can I advice to extend SearchBox or RadAutoCompleteBox control to write free text and open list box only if I digit a custom char like '@'?
I am tinking a control like Post textbox in Facebook or in Twitter where I can digit text and, if I digit '@' char opens a list with all friends o mine.

If you want extend more, it will be wonderful if you can associate more than one custom char and each custom char is associated to a different Data source.
Example:
- '@' to get products
- '#' to get Customers
- and so on...

This SearchBox must can be multiline too.

Thanks,
Francesco.
Completed
Last Updated: 27 Aug 2019 12:19 by ADMIN
Completed
Last Updated: 24 Jun 2015 14:55 by ADMIN
Completed
Last Updated: 19 Feb 2016 23:32 by chris
Completed
Last Updated: 14 Sep 2021 11:16 by ADMIN
Release Q2 2015
Completed
Last Updated: 07 Dec 2022 13:09 by ADMIN
Release R1 2023
Completed
Last Updated: 05 Nov 2014 10:37 by Elena
Completed
Last Updated: 13 Nov 2014 15:24 by ADMIN
Created by: Łukasz
Comments: 3
Category: SearchBox
Type: Bug Report
0
RadSearchBox.Focus() doesn't work in Internet Explorer. It works correctly in different browsers (Firefox, Chrome). Attached project shows the problem. 
Completed
Last Updated: 19 Mar 2014 09:22 by ADMIN
Created by: Fabrice
Comments: 2
Category: SearchBox
Type: Bug Report
1
There's a problem with radSearchbox inserted in a radWindow contenttemplate.
On First show  then inputText width is equal to 0 until a contextitem is selected or a button pushed . (test on ie10 firefox and chrome)


code example :

  <telerik:RadWindow runat="server" ID="RadWindow1" Modal="true"     AutoSize="true"
        Behaviors="Close,Move">
        <ContentTemplate>
         <telerik:RadSearchBox ID="RadSearchBox1" runat="server" Width="350" SearchContext-ShowDefaultItem="False"
                        OnClientSearch="onClientSearch" OnClientButtonCommand="onClientButtonCommand"
                        ShowSearchButton="false" Skin="Default">
                       
                        <DropDownSettings Height="150" Width="300" />
                        <Localization LoadingItemsMessage="recherche en cours....." DefaultItemText="Saisissez le nom du point ici" />
                        <WebServiceSettings Path="PointDeTournee.aspx" Method="GetResults" />
                        <SearchContext>
                            <Items>
                                <telerik:SearchContextItem Text="POI" Key="1" ImageUrl="../Img/POI/Special_Divers-Bl.bmp"  Selected="true"/>
                                <telerik:SearchContextItem Text="PA" Key="2" ImageUrl="../Img/POI/PA.bmp" />
                            </Items>
                        </SearchContext>
                    </telerik:RadSearchBox>
          </ContentTemplate>
    </telerik:RadWindow>