Silverlight 4 datagrid printing - silverlight-4.0

I have a Silverlight 4 app with RIA services. It's based on Tim Heuer's video and I have pretty much the same setup.
I have a DomainDataSource, a set of DomainDataSource.FilterDescriptors, a Datagrid which display 15 items per page with the help of a DataPager. When the user enters their filtering options, the datagrid updates accordingly but is still multiple pages which is okay for viewing on screen. I want to implement a print function that essentially prints the datagrid but all items at once and on multiple pages, if need be.
I have played around with printing basics and I can print the datagrid as it is exactly displayed on screen but I want to be able to print all items.
I'm not finding any good examples on the web. Can anyone suggest an approach to tackle this?
Thanks
Edit:
Not sure how helpful it's going to be but here's the XAML outline.

So one problem will be that when the user says they want to print, you'll presumably then want to ensure all the data is on the client (by executing some larger query), but let's assume you've taken care of that and have all the data on the clien and just want to focus on printing now.
In that case, I'd point you to David Poll's excellent additional printing helpers ( blog post here : http://www.davidpoll.com/2010/04/16/making-printing-easier-in-silverlight-4/ ). He provides a library (with full source) that basically takes an ItemsControl (or lots of other things, but ItemsControl is particularly relevant here) and paginates it automatically.
So you'd create a separate UserControl that has a "print view" of your data, which contains a DataGrid not limited to 15 items, removes paging UI, and basically gets everything "print-ready" (sort of like a print CSS sheet if you're familiar with that concept). Just point his library at that print view of your data, with all the data already on the client, and you should be just about all set.

Related

VB.NET - How to Create Information Box

I'm creating a form that will display a long list of properties and their associated value. I'd like to display them in a sort of table-like control. Something with heading values at the top and a list of organized data underneath it. Something like these:
I realize those 2 examples aren't exactly the same but I'm flexible on what I produce as long as it gives a similar effect. My question is, how do I create a list like that? Is there a control in the Visual Studio toolbox that will produce this effect?
I'm sure there's something similar that easy to find but I can't figure out what to call that control so my searches haven't turned up anything useful.
Any help would be greatly appreciated. Thanks!
A combination of ListView and TabControl controls could be used to emulate what you're showing above. See the links for ListView and TabControl to help you get started.
Yes, there are windows form controls that provides this functionality.
For the tabbed windows use the TabControl:
For the different lists use a ListView control in the mode Details - which means a list with columns:
For the second feature, the ListView control has the Group features:
In order to group items togheter set the group for the chosen item(s):
All of this can be of course done programatically. There are good tutorials on MSDN and Channel9.

SharePoint 2010 - Handling Multiple WebCharts

I'm designing a page in SharePoint 2010 which would have 10 WebCharts in it.
And on top of that page, I have to keep one drop down control which should allow the user to select different set of WebCharts as per the options they select.
For instance - if the user selects the Option-A, then he should be provided with first 5 charts and when he goes for Option-B, then he should be provided with next 5 charts. On the other hand, if he selects 'All' then he should be provided with all the 10 charts.
I have spent more time in searching for some relevant thread, but couldn't find the needed one. So please help in achieving this requirement.
Thanks for your help!
you can do this with a bit of js and css.
it will still load all charts, but if thats okay, then you can try this.
create you ddl, capture the selection.
if you wrap your charts with a div for the first 5 and a second div for the other 5 charts you can do something like
option a
$('#divA').show();
$('#divA').hide();
option b
$('#divA').hide();
$('#divB').show();
option c
$('#divA').show();
$('#divA').show();
for capturing the change event you can easily find other posts
Detect when a specific <option> is selected with jQuery
you will also have to inject a display none into the second div, since I assume you want option a visible by default.
you can use cookies to persist the change.
good luck

Data entry form in sharepoint

I was wondering if anyone knows what a simplest way to create a data entry form in Sharepoint 2010 Foundation would be. Basicly I am looking to create a form that will submit its data to a custom list on the site, I don't want the users to interact with the list directly but use the form to enter data instead.
Also I can't use Designer or InfoPath, not being able to use these is what is causing the problem it seems. Just curious if anyone else has done something like this or could point me in the right direction.
Thanks
Every list is born with forms by default - one for item creation, one for edition and one for displaying. If you use content types, then you get a trio of these for each different type.
You never interact with the list directly, you do it through these forms. If you can't use either Infopath nor Sharepoint Designer, you can still edit them by clicking on the Page tab, then the Edit Page button. From there you can add or remove web parts, and connect them among themselves.
However, the amount of control you have is too limited when compared to editing pages through either of the tools or mentioned, or Visual Studio. For example, there is no straightforward way to add or remove list fields based on content type. Be prepared for ever increasing frustration if you can't use those tools.

VB.NET - Duplicate existing form in FOR loop

Hey, I'm building a code editor app in VB.NET (Framework 4.0) and it opens all ".por" files into individual forms consisting of a MenuBar and TextBox (multi-line).
Currently I have 20 forms (all duplicates of the first on I designed) and if there are say 4 ".por" files in a directory, the first four will open up while the others hide.
I think it would be far more efficient by coding a new form For each item in form1's ListView...but I want the next so many to be a copy of the first form I designed since I spent a good bit on it.
Thanks in advance!
I decided to use tabs instead.
It wasn't difficult, the problem was I didn't know how to use a form I couldn't see.
By sticking to tabs and making a huge IF statement, simply making a new tab for each new file, and I'm getting used to using controls which haven't actually been created with the designer.
Just passing through a wall here...

Best way to select from a list - aren't the two listboxes getting a little old?

How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.