ListBox w/ checkbox element styling

2 posts, 0 answers
  1. Rich
    Rich avatar
    25 posts
    Member since:
    Jun 2010

    Posted 16 Oct 2010 Link to this post

    I have created RadListBox controls with checkboxes on a web page, but the styling of the rendered list elements shows the items on two lines, as in the attached graphic.  Here is the markup:




    telerik:RadListBox ID="lstStandards" runat="server"




    CssClass="RadListBox" CheckBoxes="true" Height="200" Width="200" />


    How can I get the entries to display on one line per entry?

    Several other listbox questions:

    1. There are code examples of automatically checking the checkbox when a list item is selected, but I would like to see how the code should be called from the control.

    2. How could I set the properterties of the control so that only the checkboxes can be used to select/unselect items?

    Rich Sorensen
  2. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 19 Oct 2010 Link to this post

    Are you using the latest version?   I don't have such problem.  It only wraps to 2 lines when listbox is shorter than the item.   Are there hidden spaces behind your value?

    1.  add this to your listbox  OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" 

            function OnClientSelectedIndexChanged(sender, args) {
                //for lstLegalReviewer to check item when selected
                var listbox = $find('<%= lstLegalReviewer.ClientID %>');
                var myItem = args.get_item()

    2.  You would have to play with OnClientItemChecked or OnClientItemChecking event.   (avoid recursion)
Back to Top