1. Senthil ramna
    Senthil ramna avatar
    67 posts
    Member since:
    Mar 2010

    Posted 17 Aug 2010 Link to this post

    how to disble typing in Combox i.e how to restrict user from typing in the combobox.
    In asp combobox to disable user entry we change the dropdown style of the combobox to DropDownList.

    the thing is i am loading items in combobox on page load and on selected index change i am redirecting it to another page based on.
    so can i validated the combobox if user types text which is not present in the combobox.
    this is how my code looks.

    <telerik:RadComboBox ID="radProject" AllowCustomText="false" AccessibilityMode="false" AutoPostBack="true" runat="server" DropDownWidth="240px" onselectedindexchanged="radProject_SelectedIndexChanged"                          EnableLoadOnDemand="true" MarkFirstMatch="true"  Skin="Web20" Filter="None">

    time being i have kept filter = none
    please suggest something...................
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Aug 2010 Link to this post

    Hello Senthil,

    I am not sure why do you set the EnableLoadOnDemand and MarkFirstMatch property of RadComboBox as true. If you want to restrict the user from typing in RadComboBox, you could set EnableLoadOnDemad and MarkFirstMatch as false along with AllowCustomText="false".
     

    Thanks,
    Princy.
  3. Senthil ramna
    Senthil ramna avatar
    67 posts
    Member since:
    Mar 2010

    Posted 17 Aug 2010 Link to this post

    Thanks a lot Princy that worked like a charm.
    Also wanted to ask if i do set EnableLoadOnDemad, MarkFirstMatch and AllowCustomText to true, how to restrict user from entering text which is not in a display member of combobox items.
    Like lets say i have India, USA and Russia as my combobox items then if i type in Spain in the combobox how to give a message to the user that this item is not present in the combobox list of items.
    i would like to do this validation in the OnSlectedindexchanged event please let me know if this can be done.
    thanks again.
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Aug 2010 Link to this post

    Hello,


    I believe, you can iterate through the radcombobox items in client side and check with the items text. The following links will help you in achieving this on client side.
    Client-Side Basics
    RadComboBox object
    RadComboBoxItem object


    Thanks,
    Princy.
  5. Senthil ramna
    Senthil ramna avatar
    67 posts
    Member since:
    Mar 2010

    Posted 26 Aug 2010 Link to this post

    Thanks for the links princy helped me lot.
    Also one other thing
    I am using Radcombobox version 2009.1.311.35.
    In this i wanted to increase the dropdown width as some of the text were of larger length, so i set the DropDownWidth size to 240px and the width of my ComboBox is 150px (standard i am using in all my pages).
    The question is this how can i make sure that the DropDownWidth will increase and decrease itself based on the size of the Items in the list. I found this http://www.telerik.com/help/winforms/combo_propertiessizing.html which looks pretty cool, where i can set the maximum and minimum DroDownSIze for the ComboBox, but this is for winforms.
    Can you tell me how i can achieve the same for ASP.NET AJAX ComboBox
    Thanks again Princy
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Aug 2010 Link to this post

    Hello Senthil,


    I hope the following code library will be of help.
    Dynamic Dropdown width


    Thanks,
    Princy.
Back to Top