ListBox Multiple selection is not working in Mac with Command button

6 posts, 0 answers
  1. Nick
    Nick avatar
    17 posts
    Member since:
    Feb 2011

    Posted 10 Sep 2012 Link to this post

    HI Support,

    I am using the listbox control and have SelectionMode="Multiple" and it works fine in window environment.

    When I open the page in Mac book either through Safari or Firefox. it doesn't select multiple record with command Button.

    This is urgent please reply me ASAP.

    Thanks
    Ajay


  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 13 Sep 2012 Link to this post

    Hi Nick,

    The following JavaScript should help you to resolve the described issue:
    var originalListBoxClickHandler = Telerik.Web.UI.RadListBox.prototype._onClick;
    Telerik.Web.UI.RadListBox.prototype._onClick = function (e) {
        if (!e.ctrlKey)
            e.ctrlKey = e.metaKey;
     
        originalListBoxClickHandler.apply(this, [e]);
    }

    Regards,
    Ivana
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nick
    Nick avatar
    17 posts
    Member since:
    Feb 2011

    Posted 15 Sep 2012 Link to this post

    Hi Ivana,

    Thanks for replying But can you tell me how I can use this javascript.

    Below is my html code example.

     <telerik:radlistbox id="lstEmployee" runat="server" height="150px" width="150px"
                                                                                                selectionmode="Multiple">
                                                                                            </telerik:radlistbox>

    Below is java script block.

    <script type="text/javascript" language="javascript">

                var originalListBoxClickHandler = Telerik.Web.UI.RadListBox.prototype._onClick;
                Telerik.Web.UI.RadListBox.prototype._onClick = function (e) {
                    if (!e.ctrlKey)
                        e.ctrlKey = e.metaKey;

                    originalListBoxClickHandler.apply(this, [e]);
                }
    </script>

    Thanks
    Nick
  5. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 18 Sep 2012 Link to this post

    Hello Nick,

    You just need to put it on the page, in a <script> block,  where the RadListBox is defined . The JavaScript code will be fired when you click on an item in RadListBox. It is a workaround for the multiple selection in RadListBox in Mac so multiple items can be selected when holding the command button and clicking on an item.

    Regards,
    Ivana
    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.
  6. Brian
    Brian avatar
    4 posts
    Member since:
    Jun 2009

    Posted 05 Feb 2013 Link to this post

    Has this been fixed.  I have a customer that is reporting the same thing.  I would rather not add java script to every page that contains a listbox as I have over 100 pages that would need this code.
  7. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 08 Feb 2013 Link to this post

    Hello Brian,

    That the above demonstrated workaround would be included in our upcoming official release - Q1 2013, which is scheduled for  20th of February.

    Greetings,
    Nencho
    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
UI for ASP.NET Ajax is Ready for VS 2017