问题
I have a datagrid that I populated with 2 arrays of strings by following the process as outlined in this question here
Now when Im trying to get selected cell values im struggling with pulling the cell values back out.
So far I have:
IList rows = dgMain.SelectedItems;
Which returns a list of the selected items, where the first item contains an object with the username and password.
My question is how do I access the username and password? I guess I need to cast the object in the list to something that will allow me to call .UserName
and .Password
on it?
Please let me know if you need anymore information.
来源:https://stackoverflow.com/questions/13010961/get-cell-values-from-a-wpf-datagrid-that-has-been-populated-with-anonymous-types