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