How can i use DataGridView in WPF Application?
-
Hi All, I want to use DataGridView which should be editable in my WPF application. In Form Base application we can simply use DataGridView But here i am unable to use it, what cade i have to written in XAML. So Please any body suggest me what i have to do to use DataGridView in WPF. Thanks Bankey
-
Hi All, I want to use DataGridView which should be editable in my WPF application. In Form Base application we can simply use DataGridView But here i am unable to use it, what cade i have to written in XAML. So Please any body suggest me what i have to do to use DataGridView in WPF. Thanks Bankey
Bankey, You can download and use distribute for free, the datagrid controls from eXceed or Infragistics. You can also write you own, depending on how much functionality you require.
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
Hi All, I want to use DataGridView which should be editable in my WPF application. In Form Base application we can simply use DataGridView But here i am unable to use it, what cade i have to written in XAML. So Please any body suggest me what i have to do to use DataGridView in WPF. Thanks Bankey
If you don't want to download something like the Infragistics or Exceed grids (and really you should look at them - they are very good), you could always host the WinForms DataGridView. If you're running VS 2008, the steps to do this are: 1. Reference System.Windows.Forms and WindowsFormIntegration in your project. 2. Add a WindowsFormsHost element to your XAML and put the grid inside
:<WindowsFormsHost Height="100" Width="200">
<wf:DataGridView x:Name="dg" />
</WindowsFormsHost>3. Add the following declaration to your XAML:
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Deja View - the feeling that you've seen this post before.
-
Bankey, You can download and use distribute for free, the datagrid controls from eXceed or Infragistics. You can also write you own, depending on how much functionality you require.
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
Karl Shifflett wrote:
You can also write you own, depending on how much functionality you require.
It's surprising that more people don't do this - considering how easy it is to extend and restyle controls like the ListView.
Deja View - the feeling that you've seen this post before.
-
Hi All, I want to use DataGridView which should be editable in my WPF application. In Form Base application we can simply use DataGridView But here i am unable to use it, what cade i have to written in XAML. So Please any body suggest me what i have to do to use DataGridView in WPF. Thanks Bankey
Bankey, This is article here on Code Project that does what you need, please have look: http://www.codeproject.com/KB/miscctrl/GridView_WPF.aspx[^]
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
If you don't want to download something like the Infragistics or Exceed grids (and really you should look at them - they are very good), you could always host the WinForms DataGridView. If you're running VS 2008, the steps to do this are: 1. Reference System.Windows.Forms and WindowsFormIntegration in your project. 2. Add a WindowsFormsHost element to your XAML and put the grid inside
:<WindowsFormsHost Height="100" Width="200">
<wf:DataGridView x:Name="dg" />
</WindowsFormsHost>3. Add the following declaration to your XAML:
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Deja View - the feeling that you've seen this post before.
Pete, I'll be off line starting tomorrow and will be back on line 28 April. I'll try and gets of pictures. I didn't get any at MIX08 so I guess I should for this trip. Cheers!!! Karl
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
Pete, I'll be off line starting tomorrow and will be back on line 28 April. I'll try and gets of pictures. I didn't get any at MIX08 so I guess I should for this trip. Cheers!!! Karl
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
Karl Shifflett wrote:
I'll try and gets of pictures. I didn't get any at MIX08 so I guess I should for this trip.
Cool. I'll try to hold the fort here while you're away :-D Enjoy your trip.
Deja View - the feeling that you've seen this post before.
-
Karl Shifflett wrote:
I'll try and gets of pictures. I didn't get any at MIX08 so I guess I should for this trip.
Cool. I'll try to hold the fort here while you're away :-D Enjoy your trip.
Deja View - the feeling that you've seen this post before.
Pete O'Hanlon wrote:
I'll try to hold the fort
When they starting piling up, remember the Alamo! Do leave you post!! LOL... Josh & I have classes together over there will be a great time! Thanks! :cool:
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
Pete O'Hanlon wrote:
I'll try to hold the fort
When they starting piling up, remember the Alamo! Do leave you post!! LOL... Josh & I have classes together over there will be a great time! Thanks! :cool:
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
Karl Shifflett wrote:
Josh & I have classes together over there will be a great time!
I'm jealous. I bet that's one hell of a time.
Deja View - the feeling that you've seen this post before.