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

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

1 Answer 71 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Priyank
Top achievements
Rank 1
Priyank asked on 18 Feb 2014, 02:12 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Feb 2014, 04:07 AM
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.
Tags
ListBox
Asked by
Priyank
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or