3 Replies - 406 Views - Last Post: 02 March 2016 - 08:28 AM Rate Topic: -----

#1 shoddy  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 75
  • Joined: 07-March 15

How to add items to WPF Controls

Posted 02 March 2016 - 01:00 AM

Hi, this may(probably is) stupid question but how can i add winforms controls(for example datagridview) to wpf controls. I mean like icon which i can drag and drop to my UI.
Here is what i mean: http://imgur.com/XRTDXUe is it possible to have datagridview there like button or textbox which i can just drag and drop in wpf.

This post has been edited by shoddy: 02 March 2016 - 01:01 AM

Is This A Good Question/Topic? 0
  • +

Replies To: How to add items to WPF Controls

#2 andrewsw  Icon User is offline

  • lashings of ginger beer
  • member icon

Reputation: 6342
  • View blog
  • Posts: 25,594
  • Joined: 12-December 12

Re: How to add items to WPF Controls

Posted 02 March 2016 - 04:20 AM

You could start here:

Walkthrough: Hosting a Windows Forms Control in WPF

There are ways to display a WinForms, or, at least, a custom control in the toolbox, see here as a start. If you are able to add the DGV directly I doubt that it would work properly, I suspect it needs a wrapper as described in the link. But the preference for WPF is to use XAML, not to drag and drop controls.

As you can see, WPF has a DataGrid. It is not as fully featured or mature as the DGV, but I believe it has improved since it was first released.

Make sure that there are no airspace violations.
Was This Post Helpful? 0
  • +
  • -

#3 shoddy  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 75
  • Joined: 07-March 15

Re: How to add items to WPF Controls

Posted 02 March 2016 - 04:55 AM

Ok thanks.
Was This Post Helpful? 0
  • +
  • -

#4 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5101
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: How to add items to WPF Controls

Posted 02 March 2016 - 08:28 AM

It's not a great idea anyway. The whole point of WPF is to not bind yourself to Windows Forms and GDI+. If you're going to use WPF, learn the WPF components.

If you truly need something more powerful than WPF's DataGrid (which is hard to believe; it's extremely flexible, you just have to do the work), you can get the "Extended WPF Toolkit" that includes tons of good controls, one of which is their "DataGrid":

http://wpftoolkit.co...rringTitle=Home
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1