Items Selected Text Causing Problem

5 posts, 1 answers
  1. Shane
    Shane avatar
    18 posts
    Member since:
    Jan 2011

    Posted 27 Sep 2011 Link to this post

    I have a screen in my application that has a multi-select RadComboBox which posts to a second application passing screen inputs as parameters.  In the past the control would pass the text parameter as a comma delimited string to the second application with the selections (ie. 123, 321, 223, 112).  After upgrading to 2011.2.915.35 this behavior has changed and now after more than 3 items are select the text is switching to "4 Items Selected".  In addition, my customer has asked to have the list display so they can directly edit the choices.  So, is there a property I can set to achieve the old behavior showing the comma delimited choices regardless the number of selected items?

    Thanks,
    Shane
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 28 Sep 2011 Link to this post

    Hello Shane,

    One of the reasons behind the change in behavior was that it was difficult to see what was in the input as in most cases the input was not wide enough. If the user wanted to see the value, they would have to move the cursor around, which not always produced the desired behavior - if some items had longs texts, the user would not be able to see them as a whole at all.

    Additionally, with the old behavior any text that was typed was not reflected by the checkboxes. If you checked/unchecked a checkbox, the text in the input would reset to a comma-delimited string and the custom typed value would be lost.

    You can achieve the desired functionality by using Templates and implementing the checkbox logic externally as shown in this demo. In this way you will have control over the code and you can change it to meet the specific requirements.

    Please let me know if you have other questions.

    Kind regards,
    Simon
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Shane
    Shane avatar
    18 posts
    Member since:
    Jan 2011

    Posted 28 Sep 2011 Link to this post

    So what you are telling me is: 

    1. Going forward the RadComboBox will no longer work the way it did before and will show "items selected" text instead with no way to override that behavior
    2. The RadComboBox still doesn't work properly for a mutli-selection if the user types in 123,234,345,456.
    3. I have to write a bunch of javascript code, using two different controls for a feature that used to be there but isn't anymore

    In some ways, that makes me feel a bit guarded on using the framework.  We thought it was great that this feature was there and could be part of our solution. 

    We had evaluated the demo solution you pointed out but the problem arises when we dynamically create multiple drop downs of this nature on one page.  In some cases these are added dynamically and with all the configuration, there is a large amount of baggage associated to the javascripts and naming for each drop down you want to add like this.

    I guess we will work through this but honestly I can say for the first time I am disappointed with the product.
    Shane

  4. Shane
    Shane avatar
    18 posts
    Member since:
    Jan 2011

    Posted 30 Sep 2011 Link to this post

    For those who may want to see the items still regardless the length.  Or like in my case, doing cross application posts and wanting the text parameter to be passed with comma separated string. 

    I used the following work around but it isn't perfect:
    On your RadComboBox, set the OnClientDropDownClosed and OnClientLoad equal to prepField and then drop the following JavaScript on your page.
    <script language="javascript" type="text/javascript">
        function prepField(comboBox)
        {   var choiceItems = comboBox.get_checkedItems();
            var newDisplay = "";
            for (var counter = 0; counter < choiceItems.length; counter++) {
                newDisplay += "" + choiceItems[counter].get_text() + ",";
            }
            comboBox.set_text(newDisplay.substring(0, newDisplay.length - 1));
        }
    </script>

    This does not help w/AllowCustomText set to TRUE, however you could probably do something with OnClientTextChange but make sure you don't get stuck in an infinite loop.  We have temporarily disabled this since none of our users complained about the certain circumstances mentioned above by Simon that it didn't work anyhow.  Hope this helps.
    Shane
  5. Answer
    Simon
    Admin
    Simon avatar
    2281 posts

    Posted 03 Oct 2011 Link to this post

    Hi Shane,

    We have discussed this change once again in response to your comments and came to the conclusion that it will be better if this behavior can be switched on/off. In the next versions of RadComboBox, including internal builds, we will implement a property that will disable the currently default behavior.

    Thank you for you input on the matter.

    Best wishes,
    Simon
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top