checkboxes as readonly

3 posts, 0 answers
  1. dennis
    dennis avatar
    39 posts
    Member since:
    Jun 2008

    Posted 27 Apr 2011 Link to this post

    Is there any way to set all the checboxes inside a radlistbox as readonly?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Apr 2011 Link to this post

    Hello Dennis,

    One easy approach is to hook OnClientItemChecking which occurs when the user selects a checkbox using mouse or keyboard and cancel the event.
    Here is a sample code:
    aspx:
    <telerik:RadListBox ID="RadListBox1" runat="server" CheckBoxes="true"
                DataSourceID="SqlDataSource1"  OnClientItemChecking="OnClientItemChecking">
    </telerik:RadListBox>

    Javascript:
    function OnClientItemChecking(Sender, args)
        {
          args.set_cancel(true);
        }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dennis
    dennis avatar
    39 posts
    Member since:
    Jun 2008

    Posted 28 Apr 2011 Link to this post


    $telerik.$(
    function() {
        $telerik.$('.RadListBox :input').attr('disabled', true);
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(function() {
            $telerik.$('.RadListBox :input').attr('disabled', true);
        });
    });

    and with this you can set it as greyed, 'prm' is because im using an update panel.
Back to Top