Multi-select and browser hilight of item text

9 posts, 1 answers
  1. Riko
    Riko avatar
    4 posts
    Member since:
    May 2009

    Posted 21 Sep 2009 Link to this post

    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?
  2. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 23 Sep 2009 Link to this post

    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.
  3. Riko
    Riko avatar
    4 posts
    Member since:
    May 2009

    Posted 25 Sep 2009 Link to this post

    Thank-you Genady, for this workaround.    Will this issue be resolved in the next release?
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 26 Sep 2009 Link to this post

    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.
  5. Andrew Ryan
    Andrew Ryan avatar
    15 posts
    Member since:
    Apr 2009

    Posted 12 Oct 2009 Link to this post

    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?
  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 15 Oct 2009 Link to this post

    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.
  7. Riko
    Riko avatar
    4 posts
    Member since:
    May 2009

    Posted 15 Oct 2009 Link to this post

    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.
  8. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 20 Oct 2009 Link to this post

    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.
  9. Riko
    Riko avatar
    4 posts
    Member since:
    May 2009

    Posted 20 Oct 2009 Link to this post

    Awesome!   Thanks for this consideration,  I really appreciate your effort.
Back to Top