Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. How can i use DataGridView in WPF Application?

How can i use DataGridView in WPF Application?

Scheduled Pinned Locked Moved WPF
wpfquestioncsharp
9 Posts 3 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bankey1010
    wrote on last edited by
    #1

    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

    L P 3 Replies Last reply
    0
    • B bankey1010

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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 Profile

      Just a grain of sand on the worlds beaches.

      P 1 Reply Last reply
      0
      • B bankey1010

        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

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        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.

        My blog | My articles

        L 1 Reply Last reply
        0
        • L Lost User

          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 Profile

          Just a grain of sand on the worlds beaches.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          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.

          My blog | My articles

          1 Reply Last reply
          0
          • B bankey1010

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            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 Profile

            Just a grain of sand on the worlds beaches.

            1 Reply Last reply
            0
            • P Pete OHanlon

              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.

              My blog | My articles

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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 Profile

              Just a grain of sand on the worlds beaches.

              P 1 Reply Last reply
              0
              • L Lost User

                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 Profile

                Just a grain of sand on the worlds beaches.

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                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.

                My blog | My articles

                L 1 Reply Last reply
                0
                • P Pete OHanlon

                  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.

                  My blog | My articles

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  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 Profile

                  Just a grain of sand on the worlds beaches.

                  P 1 Reply Last reply
                  0
                  • L Lost User

                    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 Profile

                    Just a grain of sand on the worlds beaches.

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    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.

                    My blog | My articles

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups