I have some custom controls that I would like to make more 'user friendly' in Cider (VS wpf designer). I have red all the documentation in MSDN and some sites that I found through google , but I did not find answers to some simple questions :
How to set default values for the items that are created from a collection editor (like columns in datagrid, not drag-drop from toolbox)
How to generate XAML (like the datagrid dose when you click generate columns)
Please let me know if you know of any doc that goes into details such as those mentioned above.
Also if you know/have any custom controls with visible source code that have designer support (like Xceed or DevExpress) please share a link.
Recommended books:
1- www.amazon.com/Pro-WPF-2012-Presentation-Professionals
2- any book about Design Pattern like www.amazon.com/3-0-Design-Patterns-Judith-Bishop
3- MVVM
to add a column to data grid you don't need to generate xaml, there is a column collection you can add one by code behind
dataGrid1.Columns.Add(new DataGridTextColumn{ Header = "column1"});
read the first book well and you will be good
This an excellent and rare book that goes deep into custom controls development:
WPF Control Development Unleashed: Building Advanced User Experiences
Related
How to use Data Grid as data source, and show it to DevExpress ChartControl in WPF? Or, you have alternative solution, to show chart from data grid in WPF?
Although it is possible to bind the DevExpress ChartControl and GridControl to the same view model collection, you can also use the standard WPF binding syntax to link the GridControl to the ChartControl.DataSource property (DataSource="{Binding ElementName=grid, Path=SelectedItems}").
This approach is shown in the "Data Grid Charting" ChartControl demo module from the DevExpress Demo Center. In this case, the chart's layout is automatically updated based on the actual grid selection state.
DataGrid should not be a data source for your ChartControl.
I assume that you using MVVM pattern for WPF application.
If you don't know about MVVM please read:
MVVM: Tutorial from start to finish?
In short your DataGrid from "View" is bind to a data source from "ViewModel" and ChartControl should follow the same principle, it should be bind to a data source from "ViewModel" not DataGrid itself.
Its the same as asking how do I print document from my monitor (you could do this by scanning your monitor and printing :) ).
You don't connect you printer to you monitor in order to print, you use same document as "data source" from your hard drive to display it on monitor as well as print it on printer.
Starting from DevExpress version 15.2, Report Generator tool allows you to generate a report from the DevExpress Grid View.
See the Advanced Grid Printing and Exporting help topic for more details. However, this approach will not work for the standard DataGridView. In this case, you can either use the Report Wizard to bind a report to your DataGridView's data source and generate required layout. Alternatively, you can create the report layout manually. Review the approach described in the How to create a report dynamically article.
For specific to WPF, refer below documentation links:
Grid-Based Report Generation
Please try these solutions and let me know if any of them helps.
I'm making a mixed UserControl and Control Library in WPF. I need to provide icons , other details and designer support etc... that is needed for WPF Control Library Authoring. Please help me.
A well documented sample could be better
If you search the web you will find there are a few good tutorials on adding design-time support. It is rather a broad subject to answer here! Take a look at the following:
XPlorerBar : Part 2 - Adding design-time support to the WPF explorer bar control
There is also an entire MSDN chapter on the subject:
WPF Designer Extensibility
Is there any site available where I can find free WPF controls like Griview ? I am currently working on a complex project where I need a customizable WPF Gridview like telerik
You can use controls from the WPF Toolkit as well as Extended WPF Toolkit.
Have a look at the controls in AvalonControlsLibrary on code plex, it is having a DataGridView control apart from other controls. -
http://avaloncontrolslib.codeplex.com/wikipage?title=Home&ProjectName=avaloncontrolslib
DataGridView
DataGridView is a maybe a misleading name for this control. This control is far from being the same as the WinForms DataGridView (maybe someday it will J). Basically this control is a WPF ListView control but it is capable of auto generate the GridViewColumns for you. It generates the columns by looking at the objects’ properties. You can also specify how you generate the columns by decorating your properties with a custom attribute. For more information have a look at this post. http://marlongrech.wordpress.com/2007/09/01/listview-with-auto-generation-of-column-enable-disable-columns/
Similar SF question - Where can I find free WPF controls and control templates?
On codeplex.com and codeproject.com. However the best always cost money.
I'm looking for something like a pdf or anything else that would show a chart of available controls in SL and/or WPF.
Ideally, the chart should have a drawing of the control, some succinct description and the hierarchy if possible.
Has anyone seen such a thing? Freeware or Payware, can even be from a book I could buy.
The following MSDN link lists the controls within the Silverlight SDK:
http://msdn.microsoft.com/en-us/library/cc189048(VS.95).aspx
You can try the sdk controls live following this link:
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/#/?sref=HomePage
The controls within the Silverlight Toolkit can be found here:
http://silverlight.codeplex.com/
Also, there are plenty of third party controls for Silverlight. The following link contains a list to some of them (free or not):
http://timheuer.com/blog/archive/2009/01/28/comprehensive-list-of-silverlight-controls.aspx
The controls that are shipped with the platform are fairly straightforward, so I'm not sure that would even make sense - i.e. the basic buttons, input box, text block, etc.
As for the controls that are shipped with the Toolkit, which is the richer feature set released out of band in relation to the Silverlight trunk, you can preview everything you asked for here:
http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html
What's more, the source code for the preview is included with the tool kit so it's very easy to see how any of those controls were used.
Does anybody know of a gallery of controltemplates, that I could use to learn more about what is possible with the different control types?
look at : https://github.com/jogibear9988/wpftoolkit
I've forked the Theming Package from Codeplex and switched to .Net 4.0
I'm not familiar with a gallery of control templates, though there are lots of examples on the internet. If you have a specific control you'd like to template (e.g. a ListBox or a Button), I would search for specific control templates that relate to that control. You will find countless options.
If you want to learn about what is possible with control templates, I'd suggest picking up one of the many great WPF books. A few I'd recommend are:
WPF Unleashed (by Adam Nathan)
Applications = Code + Markup by (Charles Petzold)
WPF Control Development Unleashed (by Pavan Podila and Kevin Hoffman)
You can completely recreate the visual tree of an element with a control template, so the possibilities are limitless. You can also check out the MSDN Help Topics on control styles and templates:
Control Styles and Templates
Using Templates to Customize WPF Controls
Hope that helps.
There's this one
http://www.xamltemplates.net/
There's this one
http://www.reuxables.com/
There's this one
http://www.codeplex.com/Silverlight/Wiki/View.aspx?title=Silverlight%20Toolkit%20Overview%20Part%203&referringTitle=Home
As a word of warning, all templates are not created equal - and not all templates will work across all XAML frameworks. For example if it is written for SL it may not work for WinRT. The same for WPF. But this list will get you started. In the end, you will probably create your own.