Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to get value from unknown object where property is known?

$
0
0

Hi. I need to get values from DataGrid without knowing the itemssource BUT I do know DataGridColumns sortmemberPaths.

So I would like something like: var row1Col1Value = myDataGrid.Items[0].Where(r=>r.property == myDataGridColumn1.SortmemberPath).Select(r=>r.Value).Single();

For example lets assume that DataGrid.Itemssource = List<Contract>(); AND first column.sortmemberpath = "Customer.Name"


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>