A way to increment height of Listbox to show all items?

6 posts, 1 answers
  1. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 14 Feb 2011 Link to this post

    Is there a way for the above so that when printing, all available items are shown?
  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Feb 2011 Link to this post

    Hello,

    I suggest you use @media css rule to apply specific styles to the listbox when printing. You just need to add the following css styles to your page:

    <style type="text/css">
        @media print {
             .RadListBox { height: auto !important; }
             .RadListBox .rlbGroup { position: static !important; }
        }
    </style>

    Regards,
    Yana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 24 Feb 2011 Link to this post

    I have a long list that's a couple of pages long, why is it that with or without the above CSS, the list seems to want to print from beginning of a page instead of in the middle of the page?    This leaves a big blank area for the printed page that the listbox control is in.
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Feb 2011 Link to this post

    Hi Lenny,

    Can you send us a simple page showing the exact layout? Thanks

    Regards,
    Yana
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  6. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 25 Feb 2011 Link to this post

        <div id="ucFeeChangeFeeRequest_lstSubAccountDest" class="RadListBox RadListBox_Default" style="width:380px;">
            <div class="rlbGroup rlbGroupRight">
                <ul class="rlbList">
                    <li id="ucFeeChangeFeeRequest_lstSubAccountDest_i0" class="rlbItem"><span class="rlbText">list item1</span></li>
                </ul>

    lots of items here

            </div><input id="ucFeeChangeFeeRequest_lstSubAccountDest_ClientState" name="ucFeeChangeFeeRequest_lstSubAccountDest_ClientState" type="hidden" />
        </div>

    The problem would only occur if there are many items spanning pages, as if there is a page-break-before was included.
    Ah, according to http://www.w3.org/TR/CSS2/sample.html      ul has default of page break.
     ul { page-break-before: avoid }
    
    I tried changing this but it still page breaks before start of ul.
    
     ul { page-break-before: auto }
    or
    
     ul { page-break-before:  }
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Mar 2011 Link to this post

    Hi Lenny,

    Thank you for sending the explanation.

    I've attached a simple page to demonstrate how to fix it, please download it and give it a try.


    Kind regards,
    Yana
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017