Get Selected Row Values

2 posts, 0 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 23 Apr 2012 Link to this post

    I have a grid that is populated  with a List<DataRow>
    The issue I am having is on Selection Changed even how do I return the value in the first column, HolderID' of the selected row?
  2. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 23 Apr 2012 Link to this post

    Ok I have fornd one way, hopefully yhere is a better way.
    Here is what I was able to do to get it to work

     var s = e.AddedItems;
     foreach (var item in s)
                {
                  DataRow row = (DataRow)item;
                  selectedItem = row.ItemArray[0].ToString();
                }
    Is there a better way?
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top