New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Hide SearchBox on Initial Load

Environment

ProductRadSearchBox for ASP.NET AJAX

Description

If you want to hide the SearchBox initially and then display it on some action like a button click, its input text width is getting truncated and cut.

Solution

You can resolve it using one of these options:

  1. Call the repaint() method after showing it:
JS
function showSearchBox() {
    var searchBox = $telerik.findControl(document, "RadSearchBox1");
    searchBox.set_visible(true);
    searchBox.repaint();
}
  1. Hide the searchbox initially after some delay:
JS
function pageLoad(app, args) {
    var searchBox = $find('<%= RadSearchBox1.ClientID %>');
    hideSearchBox(searchBox);
}
function hideSearchBox(searchBox) {
    setTimeout(function () {
        searchBox.set_visible(false);
    }, 50);
}
  1. Hide it using visibility instead of display:
ASP.NET
<telerik:RadSearchBox ... Style="visibility: hidden;">
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support