I'm trying to print a grid that would comprise multiple pages from Silverlight 4.
The grid consists of a 'header section' (another grid with date, image, etc) setup as I needed it to look and a ItemsControl with a data template who's item source is set to an observable collection of objects.
All I set in the code so far is PageVisual 开发者_StackOverflow中文版(to the grid) but all I get is the first page. So I believe I have to set HasMorePages (since the default is False).
But to do this, is it true I need to calculate the # pages in my code based on the # objects in my observable collection? Such as by looping through the collection and creating uielement for each on a new stackpanel or the like? Or is there something I'm missing?
Also is there a way to use the 'header section' I already created? I tried looping through the collection as mentioned above, but if I try and add the header grid to the a new stackpanel it says it is already child of a another element. I don't want to have to create the header in c# code since it is already layout in xaml. Any ideas?
thanks!
check this out:
Silverlight Business Apps: Module 6.2 - Multi Page Printing
http://channel9.msdn.com/learn/courses/Silverlight4/SL4BusinessModule6/SL4LOB_06_02_MultipagePrinting/
精彩评论