Creating Custom Layouts to Present Data - c#

I'm trying to find a package, or a solution that allows me to create custom layouts to present data. Similar to how one can create custom templates and layouts in Microsoft Word.
I've tried a RichTextBox but they are very limited. I want to create numerous custom layout types to present the data within my software and have the user select one they wish to use, with the option of printing.
Is there anything that will allow me to do this?
This is for a WinForms application.
The layouts will be designed by myself, and added into the software. The layouts will be used to present the data. Mainly for aesthetics. The application allows the user to enter their information for a CV and they can select a layout for their CV.

Hmmm. I would suggest WPF if you were not committed to a WinForms application.
Instead you can use HTML and swap out the CSS (cascading style sheet) on the fly. You will need to use a WebBrowser control to host the html (http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser(v=vs.110).aspx).
Otherwise you could creat several controls that could bind to the same data object and swap the controls out. I like the HTML option better myself.

Related

Displaying code with numbered code lines

I'm working on a windows forms application that reads and displays source code files from my hard drive. I'm not sure which control would be best suited for this. Is there any library that will allow me to display the source code with colors and numbered code-lines?
EDIT: To clarify, what i'm looking for is a way to display the code with colors and line-numbers, no need for editing. The application is to be used by a teacher, allowing him to view source code files handed in by his students. The teacher doesn't have to be able to edit the files.
ScintillaNet is a WinForms control which is a .NET wrapper of the excellent Scintilla library and is quite good. Avalon which is mentioned in another answer is also very good, but it is an WPF control (of course, WPF controls can be added to WinForms forms by using ElementHost controls, but it will introduce additional complexity which may or may not be warranted).

Creating a .NET page to embed other .NET pages

I have created certain functionalities for an application. These functionalities include -
ADD USER
EDIT USER
DELETE USER and so on
Now I have written all these in seperate pages. So when I have to delete a user I go to USER_DELETE.aspx page to do that.
My new requirement is that there should be a single page from which all these can be done. Being more specific, I want that there should be separate panels in a page called "USER_MANAGER". Each panel will have the required functionality.
Is there a way I can do this by just creating the new UI of the USER_MANAGER page and calling the other pages (as User Controls or any other easier way) into the UI of USER_MANAGER?
I don't want to do any changes to the existing pages for various functions. I hope the question is clear, I am a bit novice in this technology so I am not really sure.
Thanks and regards
It sounds like you want to turn your pages in to ASP.NET User Controls. User Controls are just as easy to create as pages and can be used in similar fashion as Server Controls. If you want to create controls that can be shared between projects, then you want to write Server Controls but thos cases are probably not so common.
There are many ways to tackle this problem. If you are listing the users in a gridview you could use inline editing and do it within there.
You could retain the pages you wrote and use a modal popup or iframe. Another way would be with a multiview or tabs or panels.
I would design the UI and the then decide what the best solution for your application is then write these elements.

Allow users to create own workflow scenarios

I have such task:
allow users to create smth like template forms(from predefined controls like in any CMS for web) and some workflows to be used in that forms. For example user can create form of generating some report, and after submitting it-another form must be shown, but all that should happen dynamically without hiring developer to extend the existing code. Is it possible to give some predefined scenarios to the users and allow them to choose some actions, combining that scenarios? I know that we can write such thing, but there may be many errors while implementing that and i hope there is some ready solution..
Is there a sort of CMS for Winforms/WPF?..Can you suggest the best way to finish such task?
Use WPF. You could let them enter the XAML in form of a text file or a text box and then execute it on runtime using XamlReader.

how to show a windows folder contents in a windows form using .NET?

i want to show the folder contents in my windows form from where user can copy paste the files user needed, what type of container i have to use for this purpose?
Basically you have two options. You can get an already build control and use it in your application, there are lots of them but not very good and you'll have to pay for one.
Or you could use a TreeView / ListView and build your own control that will suite best what you need. Here is an example explained and with source code.
Another alternative is you can get the Windows API Code Pack which contains a managed wrapper for the actual explorer shell control which basically allows you to embed explorer directly in your application.
before i used Ultra win tree(infrajestics control) to view all files with in the tree view.
Consider using the FolderView and FileView controls from Shell MegaPack.
Assuming :
the design requirements prohibit showing the actual location of the files the end-user can copy or paste. Assume all file names shown are stripped of their path locations.
the list of files is "flat" (no treeview type display is needed)
there's a need to move, or copy, one or more files from an original "complete" list to another "partial list"
I'd create an interface with two ListViews in a Panel : one column per ListView wide enough to display file names : allow multi-select in both of them.
I'd either implement drag-and-drop using standard techniques, or, more likely, I'd create a set of buttons with arrows to move items back and forth between the ListViews. I might have seperate delete buttons for each ListView and require the end-user to confirm deletion depending on the application.
If "multiple copies" (more than one list entry with identical content) are allowed I would probably use some keyboard options to control this, particularly if I were drag/dropping.
Depending on the application, I'd think about letting the end-user make "snapshots" of the current state of the two ListViews, which could then be "restored" : while a simple "Cancel" button could take care of the case where you want to reset the whole thing.

Developing wizard UI - WPF

All in WPF:
Developing a wizard application, user has to answer a number of simple questions before brought to the main app. The main app is then prefilled with the information obtained from the wizard.
I started with a Window which I then planned to add usercontrols to. The main window would have the user control in the first row, then Next and Previous buttons to control moving between the controls in the second row. This way I could easily control the logic to switch between screens like:
WizardControl1.IsVisible = false;
WizardControl2.IsVisible = true;
But for some reason, user controls do not have setter for IsVisible. Hurray.
So then I thought I would just use seperate windows for each section of the wizard. The problem with this approach is that now when stepping between, the window opens in random positions, and by steppign through the wizard with next, the next window pops up randomly which is really distracting and frustrating.
So how can I develop a wizard properly? I don't get why this is so hard...not exactly rocket science... replacing text and controls and storing input after pressing next/previous!
Thanks
Check this link:
http://www.codeproject.com/KB/WPF/InternationalizedWizard.aspx
This is the article about building wizard in WPF by Josh Smith, it's seems to be nice pattern.
I found it's helpful for me, hope you'll too.
There is also an open source Avalon Wizard control on codeplex.
I'd probably aproach this using data binding and template selectors. Have the wizard form bind to a "WizardData" class, which exposes a list of "WizardPage" base classes.
The WizardData class can expose properties defining the correct info on the forms, and display a control for the main page that uses a template selector to determine the proper control to display based on the actual type of the particular wizard page.
It sounds like more work than it is, really. It also gives you the benefit of good separation between code and UI (all "work" is done by the WizardData and WizardPage classes), and the ability to test logic independent of the UI.
It's also a very WPF/MVVM way of approaching the problem.
I recognize this does not directly address your question, but I thought I'd mention it as a possible alternative. I've used Actipro's Wizard control with pretty good results, and when I have needed support, they have been very responsive. I am not affiliated with them in any way; I just like not having to write the plumbing to manage a wizard.
The property is called "Visibility".
I find that I do better when I dynamically add and removing controls rather than hide them.
I was looking for a Wizard solution too. I have the need to stick with stock WPF components so I implemented the wizard using a standard form and a tab control.
I only hide the tabs at runtime so there available in the IDE. At runtime just use Back, Next, Finish... to navigate thru the tab items
works good

Categories