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. Extracting cell content using ItemsSource in WPF DataGrid

Extracting cell content using ItemsSource in WPF DataGrid

Scheduled Pinned Locked Moved WPF
questiontoolscsharpcsswpf
3 Posts 2 Posters 0 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.
  • R Offline
    R Offline
    retZ
    wrote on last edited by
    #1

    I am trying to get content of a WPF data grid cell using this method: ...objGrid.ItemsSource.Item().ColumnName Question is how can I parameterize the columnname instead of having to hardcode it? For example, can I do something like this: ..objGrid.ItemsSource.Item().Column(") ???? OR like this.. ..objGrid.ItemsSource.Item().Column("") ???? I am trying to get away from having to hardcode the columnname. (Long story short, this is for a test automation script that needs to be data driven.) Any suggestions most welcome! Thank you!

    M 1 Reply Last reply
    0
    • R retZ

      I am trying to get content of a WPF data grid cell using this method: ...objGrid.ItemsSource.Item().ColumnName Question is how can I parameterize the columnname instead of having to hardcode it? For example, can I do something like this: ..objGrid.ItemsSource.Item().Column(") ???? OR like this.. ..objGrid.ItemsSource.Item().Column("") ???? I am trying to get away from having to hardcode the columnname. (Long story short, this is for a test automation script that needs to be data driven.) Any suggestions most welcome! Thank you!

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      But but why are you working on the data via the UI, surely you would work with the bound collection!

      Never underestimate the power of human stupidity RAH

      R 1 Reply Last reply
      0
      • M Mycroft Holmes

        But but why are you working on the data via the UI, surely you would work with the bound collection!

        Never underestimate the power of human stupidity RAH

        R Offline
        R Offline
        retZ
        wrote on last edited by
        #3

        Good point, Mycroft :-) However, this is a for a test automation script. The automated test script needs to validate cell values on the grid (UI) as it navigates through the application under test. There are no failures.. only extended learning opportunities.

        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