on page load set empty message in combo box

2 posts, 0 answers
  1. Rahul
    Rahul avatar
    39 posts
    Member since:
    Jan 2014

    Posted 12 Jan 2014 Link to this post

    Hi,
                 I have multiple Combo Box on my page. when i select combo box values then process on it then my page is reload that time i want set empty message on every combo box not show selected value. provide me sample code.

    Thanks,
    Rahul
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jan 2014 Link to this post

    Hi Rahul,

    Please have a look into the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" />
            <telerik:RadComboBoxItem Text="Item2" />
            <telerik:RadComboBoxItem Text="Item3" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    <script type="text/javascript">
        function pageLoad() {
            var combo = $find("<%=RadComboBox1.ClientID %>");
            combo.clearSelection();
            combo.set_emptyMessage("select");
        }
    </script>

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top