This is a migrated thread and some comments may be shown as answers.

Items Selected Text Causing Problem

4 Answers 87 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 27 Sep 2011, 05:05 PM
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

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 28 Sep 2011, 03:55 PM
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
0
Shane
Top achievements
Rank 1
answered on 28 Sep 2011, 10:27 PM

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

0
Shane
Top achievements
Rank 1
answered on 30 Sep 2011, 07:03 AM
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
0
Accepted
Simon
Telerik team
answered on 03 Oct 2011, 10:53 AM
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
Tags
ComboBox
Asked by
Shane
Top achievements
Rank 1
Answers by
Simon
Telerik team
Shane
Top achievements
Rank 1
Share this question
or