Is there a MaxLength property for Custom Text?

5 posts, 0 answers
  1. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 18 Aug 2009 Link to this post

    I want to restrict the number of characters that someone can enter on the ComboBox, but I don't see a maximum length property. Can you point me to it? I don't want to create an event handler for TextChanged/LostFocus for every combobox to check the length.
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 19 Aug 2009 Link to this post

    Hi Dennis,

    Unfortunately RadComboBox does not provide such property and the event handler seems to be the only option.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 19 Aug 2009 Link to this post

    Is this a feature that you can add so that I don't have to create an event handler for each ComboBox that needs a maximum length - let alone if there were multiple comboboxes on a single page.
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 19 Aug 2009 Link to this post

    Hi Dennis,

    We try to avoid making the controls too complex, if an uncommon scenario can be achieved with an event handler, I would rather let the developers implement it this way, instead of adding a property to turn on/off the feature. However, if you share your use case, I could discuss it with the other developers and consider the implementation of such property.

    If it is a matter of setting a single property, instead of attaching an event handler in the XAML, you could implement the functionality as an attached behavior, that will be used like this:
    <telerikInput:RadComboBox local:ComboBoxExtensions.MaxLength="10" ... />
    which is virtually the same as a property in RadComboBox. In this case you will set the handler in the PropertyChanged callback of the MaxLength attached property. Please, let me know if you need an example and I will provide you with one.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 19 Aug 2009 Link to this post

    I was actually hoping for the opposite - a feature rich control set that I wouldn't have to extend. So, maybe I am looking at your Silverlight controls completely the wrong way. I was hoping that the controls would work and present some of the same functionality that the ASP AJAX controls support (and that switching between the two would be simple and intuitive because they would be based on a similar object model).

    Maybe one of your goals is to create smaller footprints for downloads, which leads to trimmed down, minimum functionality in the core controls, but while potentially user-friendly, this model is not developer friendly if I have to extend the controls myself (or learn 2 different object models). And by extending, I have to recreate that initial footprint, anyway. My users will not be on dial-up, so the footprint size is moot to me - especially since it can be cached.

    I will look at the behavior approach, but if I cannot data bind the property then it will not help my situation. Either way, I need to find out how to create the behaviors programmatically as all the ComboBox's are being created programmatically.

    My Use Case is probably very unique. I have 2 clients versions (ASP AJAX and Silverlight) attaching to the same backend web services for an n-tier enterprise application (used internally). The primary use of touching all the properties of every control is that the application provides a "Form Designer" that allows an end-user (specifically a BA) to create a form in the system that is rendered and used within the application (inline with Windows Workflow on the server).

    So, I wanted to make a variety of controls available to the Form Designer and then have a good set of properties available to the end user to set. This works very well under your AJAX controls. I am struggling with the Silverlight controls. I am not trying to make Silverlight into a "fat" client, but I expect that they would provide similar functionality that can be found through basic web pages now.

    Thanks.
    Dennis
Back to Top
DevCraft banner