This is a migrated thread and some comments may be shown as answers.

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

5 Answers 224 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 14 Feb 2011, 11:00 PM
Is there a way for the above so that when printing, all available items are shown?

5 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 15 Feb 2011, 09:32 AM
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.
0
Lenny_shp
Top achievements
Rank 2
answered on 24 Feb 2011, 11:22 PM
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.
0
Yana
Telerik team
answered on 25 Feb 2011, 04:27 PM
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!
0
Lenny_shp
Top achievements
Rank 2
answered on 25 Feb 2011, 09:22 PM
    <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:  }
0
Yana
Telerik team
answered on 02 Mar 2011, 02:28 PM
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!
Tags
ListBox
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Yana
Telerik team
Lenny_shp
Top achievements
Rank 2
Share this question
or