How to use a DataGrid or DataGridView in a WPF application
In WPF 1.0, there is no grid-like control. We can host windows forms datagrid inside our WPF. Here to use the behavior of DataGrid as in ASP.NET 2.0, we use a DataGridView in .NET 3.0.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How to use a DataGrid or DataGridView in a WPF application
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

meysam hooshmandPosted Jan 18, 2010, 4:46 AM
hello Rahul, i encountered an error, """ Cannot create instance of 'Window1' defined in assembly 'DataGridinXAMl, Version=1.0.3670.23819, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Window1.xaml' Line 1 Position 9. """" what is your solution??? thx
Manu xamlPosted Apr 25, 2009, 3:59 PM
Is there a way to dynamically set the SelectedIndex="" from a datagrid tag? I want to set it based on the last modified record.
HappyarimaaneditedPosted Dec 12, 2008, 4:12 AMEdited Dec 12, 2008, 4:15 AM
Use of InitializeComponent gives an error :"Name "InitializeComponent" is not declared." Why is it so ? However when I remove the 'Namespace' declaration the error goes away.