How to delete the checked items alone from radlistbox

2 posts, 0 answers
  1. suresh
    suresh avatar
    30 posts
    Member since:
    Apr 2011

    Posted 16 Oct 2013 Link to this post

    I have using radlistbox with checkboxes="true" and  AllowDelete="true" , I am able to checked and unchecked the items. But the default delete option only delete the selected single item. I want to delete checked items only. Is it possible?

    Here is the code.
    <telerik:RadListBox ID="rlbManaged" EmptyMessage="No objects added" Width="100%"
                    AllowDelete="true" Height="120px" 
                    CheckBoxes="true" runat="server" SelectionMode="Multiple">
                       <items>
                        <telerik:RadListBoxItem Text="item1" />
                        <telerik:RadListBoxItem Text="item2" />
                        <telerik:RadListBoxItem Text="item3" />
                    </items>
        </telerik:RadListBox>
    I need to delete the checked items(For example i checked item1 and item3) instead of selected single item. How can i do?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2013 Link to this post

    Hi Suresh,

    Please have a look into the following code I tried which works fine at my end.

    ASPX:
    <telerik:RadListBox ID="rlbManaged" EmptyMessage="No objects added" AllowDelete="true"
        OnClientItemChecked="OnClientItemChecked" Height="120px" CheckBoxes="true" runat="server"
        SelectionMode="Multiple">
        <Items>
            <telerik:RadListBoxItem Text="item1" />
            <telerik:RadListBoxItem Text="item2" />
            <telerik:RadListBoxItem Text="item3" />
        </Items>
    </telerik:RadListBox>

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

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top