Select Single Value from drop down and Add Styles.

2 posts, 1 answers
  1. Anly
    Anly avatar
    14 posts
    Member since:
    Feb 2013

    Posted 13 Feb 2013 Link to this post

    Hi,

    I am having a RadAutoCompleteBox and RadTextBox in one of my pages. My requirement is that I must be able to select only one value from the dropdown that must be shown in a desired color and after selecting the item from the drop-down, I want my textbox to be focussed.

    Please help.
    -Anly.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Feb 2013 Link to this post

    Hi Anly,

    You can set the TextSettings SelectionMode to Single so that only one value can be selected from the drop-down. You can use the OnClientDropDownClosed event to change the focus to the RadTextBox once a value is selected from the drop down.

    ASPX:
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" EmptyMessage="Enter Name"
        ForeColor="Red" InputType="Text" DataSourceID="SqlDataSource2" DataTextField="ContactName"
        OnClientDropDownClosed="OnClientDropDownClosed">
        <TextSettings SelectionMode="Single" />
    </telerik:RadAutoCompleteBox>
    <telerik:RadTextBox ID="RadTextBox" runat="server">
    </telerik:RadTextBox>

    Javascript:
    <script type="text/javascript">
        function OnClientDropDownClosed(sender, args) {
            document.getElementById("RadTextBox").focus();
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top