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

Multi-select and browser hilight of item text

8 Answers 142 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Riko
Top achievements
Rank 1
Riko asked on 21 Sep 2009, 03:59 PM
Hi,

I'd just like to point out some presentation nastiness with RadListBox and multi-select.    Aside from the control hilighting the selected items, the browser is also highlighting item text which results in highlighting situations like the screen cap found at the link below:

http://www.marinko.ca/screencaps/CustomHilight.jpg

This is also an issue on your demo:
http://www.marinko.ca/screencaps/DemoHilight.jpg

Is there any way to prevent the browser from hilighting the item text above and beyond the control's own item highlight?

8 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 23 Sep 2009, 11:36 AM
Hello Riko,

You can use the following JavaScript to disable the text selection in the RadListBox. You will still be able to select items, however the blue browser text selection won't appear:

    <script type="text/javascript"
        function pageLoad() { 
            var listBoxDiv = $get("RadListBox1"); 
            disableSelection(listBoxDiv); 
        } 
 
        function disableSelection(target) { 
            if (typeof target.onselectstart != "undefined"
                target.onselectstart = function() { return false } 
            else if (typeof target.style.MozUserSelect != "undefined"
                target.style.MozUserSelect = "none" 
            else  
                target.onmousedown = function() { return false } 
            target.style.cursor = "default" 
        } 
 
    </script> 


Best wishes,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Riko
Top achievements
Rank 1
answered on 25 Sep 2009, 06:46 PM
Thank-you Genady, for this workaround.    Will this issue be resolved in the next release?
0
Genady Sergeev
Telerik team
answered on 26 Sep 2009, 02:04 PM
Hi Riko,

At the moment, we do not think that this is an issue to be fixed. Imagine if one needs to copy the text of the selected items. This will not be possible if we disable the text selection functionality.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Andrew Ryan
Top achievements
Rank 1
answered on 12 Oct 2009, 05:31 PM
But,

Certainly if you've enabled drag drop, then "selected" the list box item wouldn't be possible?

I also am struggling with this control, moving from a homegrown composite control that I've used for like 4 years to this control. The homegrown control uses two ListBoxes and so this isn't an issue. I would guess that most people would want to use this like a normal ASP.NET list box and never want to cut-paste from it. However, I suggest a property called DisableBrowserHighlight, set to true by default, because this is pretty nasty.

Can we vote on this?
0
Genady Sergeev
Telerik team
answered on 15 Oct 2009, 04:43 PM
Hello Andrew Ryan,

Actually what you say makes sense. We will discuss the topic, however you are wrong in that one is not allowed to select and copy text in the standard ListBox. You can select and copy text, however, the visual representation of the selected text is different.

Greetings,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Riko
Top achievements
Rank 1
answered on 15 Oct 2009, 04:54 PM
I agree this should be a feature.   In this UI scenario, I would expect this to work like a plain old html SELECT box where you can't have two mutually exclusive range selections visually represented at the same time.    I.e. one for the selected items, and another for selected range of item text.    It really gets in the way.
0
Genady Sergeev
Telerik team
answered on 20 Oct 2009, 02:30 PM
Hi guys,

Based on your feedback we have decided to disable the text selection on RadListBox. The feature should be ready for the Q3 release.

All the best,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Riko
Top achievements
Rank 1
answered on 20 Oct 2009, 02:39 PM
Awesome!   Thanks for this consideration,  I really appreciate your effort.
Tags
ListBox
Asked by
Riko
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Riko
Top achievements
Rank 1
Andrew Ryan
Top achievements
Rank 1
Share this question
or