In WPF how to use GridView? - wpf

In WPF there is listview but no GridView control. I am familier with ASP.NET's GridView how to insert,update and delete, its events like Rowupdating, RowEditing etc. Now I want to do same things in WPF. Please provide some working example.

I think you're looking for the DataGrid. Here's a CodeProject article with examples and code: http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx

You should use the DataGrid control.

Here are the examples for using WPF ListView and WPF DataGrid

Related

WPF Expander that works like a Popup

I'm looking for an expander control where the expanding part is more like a popup. Similar to a ComboBox's dropdown functionality.
Is there anything built into WPF that works like that? If not, Best recommendations?
Thanks!

Where can i find Free WPF controls

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.

WPF Data Grid Example

I've been experimenting with WPF and just downloaded the toolkit which includes a DataGrid control. Does anyone know where I can find a fully worked through example of binding a database table to the WPF DataGrid?
Here is a blog that has some articles on DataGrid binding.

WPF design-time context menu

I am trying to create a custom wpf control, I'm wondering how I can add some design-time features. I've googled and can't seem to get to my goal.
So here's my simple question, how can I add an entry to the design-time context menu for my WPF usercontrol? The context menu by default has entries View Code,View XAML, etc.
You probably want to check out the WPF Designer Extensibility documentation. Specifically it sounds like you want to create a custom MenuAction.
This will help you get the context menu you require, although this applies to datagrid's still applicable;
WPF DataGrid Design-time Walkthrough

WPF Treeview ShowRootlines

Is there a way to show Root lines in a WPF Treeview?
Or do you have to resort to doing something complicated like using Control Templates
The Winforms treeview has a ShowRootLines property but none exists for the WPF treeview.
Thanks
The answer is that you must create your own templates to do this. Here's a post in the MSDN forums with an answer from a MSFT rep on how you can accomplish this.

Resources