Selected Radlistbox item gets deselected while clicking the selected item along with shift key

2 posts, 0 answers
  1. Priyank
    Priyank avatar
    13 posts
    Member since:
    Nov 2013

    Posted 18 Feb 2014 Link to this post

    Hi,

    The issue I'm facing is that the selected Radlistbox item gets deselected while clicking the selected item along with shift key.

    I want it to remain selected.

    How can I change this behavior?

    Thanks,
    Priyank
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Feb 2014 in reply to Priyank Link to this post

    Hi Priyank,

    Please have a look into the sample code snippet to achieve your scenario.

    ASPX:
    <telerik:RadListBox ID="RadListBox1" runat="server" SelectionMode="Multiple" OnClientSelectedIndexChanging="OnClientSelectedIndexChanging1">
        <Items>
            <telerik:RadListBoxItem Text="Item1" />
            <telerik:RadListBoxItem Text="Item2" />
            <telerik:RadListBoxItem Text="Item3" />
        </Items>
    </telerik:RadListBox>

    JavaScript:
    <script type="text/javascript">
        function OnClientSelectedIndexChanging1(sender, args) {
            if (args.get_item().get_selected())
                args.get_item().set_selected(true);
        }
    </script>

    Hope this will helps you.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top