4

I want to use the DataGridView in my WPF project. I see it in my toolbox list but it is inactive. I cannot figure out how to activate it and make available to my project.

Green Falcon
  • 818
  • 3
  • 17
  • 48
Cass
  • 537
  • 1
  • 7
  • 24
  • #Karolis -- But it is not availabsle for me to place inside a DataGrid. It is greyed out in my toolbox. Also in the xml when I type – Cass Nov 12 '16 at 20:59
  • DataGridView only exists in WinForms and you must have a toolbox for it as well. – Karolis Kajenas Nov 12 '16 at 21:02

1 Answers1

3

I see it in my toolbox list but it is inactive.

DataGridView is a windows forms control and can not be used in a WPF window directly. For a WPF project you need to use DataGrid control.

You should right click on toolbox and uncheck Show All, this way you will see just those components which are available for the current open designer.

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
  • Thank you all. I was confused on how it worked. Whenever I do a google search it always brings up datagridview and someone had says said datagridview was the replacement for daragrid. – Cass Nov 12 '16 at 22:02
  • The `System.Windows.Forms.DataGridView` is a replacement for `System.Windows.Forms.DataGrid` which is different from `System.Windows.Controls.DataGrid`. – Reza Aghaei Nov 12 '16 at 22:04