Complete hiding loading message in google like search

3 posts, 1 answers
  1. Yeroon
    Yeroon avatar
    87 posts
    Member since:
    Oct 2012

    Posted 09 Mar 2010 Link to this post


    I use the following code to have a google like search of a MSSQL2008 database. MsSql 2008 now offers the Full text catalog indexed keywords in a queryable format. Using this list offers search suggestions like google. I retrieve the keywords, put them in App Cache and use it in the Itemsrequested event. I managed to mimic google by adding an itemtemplate to the radcombo, hiding the dropdown arrow, not expanding on ficus etc. But now I set the loading message to an empty string, but the loading bar will still be visible while typing. How can I hide this?

    Here's my code. Based on the latest Q3 release. Net framework 3.5. I am posting all code because others might find it interesting. Not really neccesary for my question.

    The webservice that queries the keyword index on MsSQL 2008 full text catalog (uses system stored procedure:

            public DataSet GetCatalogKeywords(string searchTerm)  
                //Build the SqlCilent Objects we need   
                SqlConnection conn = new SqlConnection("server=; database=MyDatabase; User Id=saPassword=MyPassword");  
                SqlCommand cmd = new SqlCommand();  
                //SqlDataAdapter to populate our DataSet   
                SqlDataAdapter adapter = new SqlDataAdapter();  
                //DataSet to hold the users information   
                DataSet dsInfo = new DataSet();  
                //String to hold our stored procedure   
                const string query = "WebserviceKeySearch";  
                //try...catch block to handle any unhandeled exceptions   
                    //set our SqlCommands Objects   
                    cmd.CommandText = query;  
                    cmd.CommandType = CommandType.StoredProcedure;  //tell it its a Stored Procedure we're executing   
                    cmd.Parameters.AddWithValue("@searchTerm", searchTerm);  
                    cmd.Connection = conn;  
                    adapter.SelectCommand = cmd;  
                    //fill our DataSet   
                    //using the Fill Method of   
                    //the SqlDataAdapter   
                    //return the DataSet to the calling aspx page   
                    return dsInfo;  
                catch (Exception ex)  
                    return null;  

    The stored procedure:


    SELECT distinct display_term, sum(document_count) AS HitCount








    (DB_ID('Hezelbase'), OBJECT_ID('Regeling')) where display_term like @searchTerm + '%' group by display_term order by display_term



    The aspx page with RadCombo as searchbox:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
    <html xmlns="">  
    <head runat="server">  
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /> 
        <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <telerik:RadScriptBlock ID="rsbc" runat="server">  
            <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">  
                <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="330px" Height="150px" DropDownWidth="420px" 
                    EmptyMessage="Zoeken..." EnableLoadOnDemand="True" ShowMoreResultsBox="false" HighlightTemplatedItems="true" ShowDropDownOnTextboxClick="false" 
                    ShowToggleImage="false" ShowWhileLoading="false" AccessibilityMode="true" CloseDropDownOnBlur="true" LoadingMessage=""   
                    OpenDropDownOnLoad="false" EnableVirtualScrolling="false" OnItemsRequested="RadComboBox1_ItemsRequested">  
                        <table style="width: 325px" cellspacing="0" cellpadding="0">  
                                <td style="width: 200px;">  
                                    <%# DataBinder.Eval(Container, "Text")%> 
                                <td style="width: 100px; color:Green;">  
                                    <%# DataBinder.Eval(Container, "Attributes['HitCount']")%> 

    The code behind:

    using System;  
    using System.Data;  
    using HezelbaseWebService;  
    using Telerik.Web.UI;  
    public partial class Default : System.Web.UI.Page   
        protected void Page_Load(object sender, EventArgs e)  
        private void fillCahceFromService()  
            Service1 s = new Service1();  
            DataSet ds = s.GetCatalogKeywords("%");  
            Cache["Webservicedata"] = ds;  
        protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  
            RadComboBox combo = (RadComboBox)o;  
            if(Cache["Webservicedata"] == null || Cache["Webservicedata"].GetType() != typeof(DataSet))  
            if (e.Text.Length > 1)  
                DataSet ds = (DataSet)Cache["Webservicedata"];  
                if (ds != null && ds.Tables.Count > 0)  
                    DataRow[] dataRows = ds.Tables[0].Select("display_term like '" + e.Text + "%'");  
                    foreach (DataRow dataRow in dataRows)  
                        RadComboBoxItem item = new RadComboBoxItem();  
                        string HitCount = dataRow["HitCount"].ToString();  
                        item.Text = (string)dataRow["display_term"];  
                        item.Attributes.Add("HitCount", HitCount + " results");  
  2. Answer
    Simon avatar
    2281 posts

    Posted 11 Mar 2010 Link to this post

    Hi Yeroon,

    You can hide the Loading message with the following CSS class:

        display: none;

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Telerik UI for ASP.NET Core is out
  4. Yeroon
    Yeroon avatar
    87 posts
    Member since:
    Oct 2012

    Posted 11 Mar 2010 Link to this post


    That did the trick :)

    Thank you very much!

Back to Top