checkbox in radlistbox

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 05 Mar 2013 Link to this post

    Hi,

    I have a RadListBox on my page with the CheckBoxes set to "true". How can you set the RadListBox that when a user selects an item, the checkbox is set as well and when a user checks a CheckBox, the item gets selected?

    Tnanks,
    Sigma
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Mar 2013 Link to this post

    Hi,

    Please try the following code snippet.

    ASPX:
    <telerik:RadListBox ID="ListBox1" runat="server" CheckBoxes="true" SelectionMode="Multiple"
                OnClientItemChecked="OnClientItemChecked" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"> . . .

    Javascript:
    <script type="text/javascript">
        function OnClientSelectedIndexChanged(sender, args) {
            args.get_item().set_checked(args.get_item().get_selected());
        }
        function OnClientItemChecked(sender, args) {
            args.get_item().set_selected(args.get_item().get_checked());
        }
    </script>

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