This is a migrated thread and some comments may be shown as answers.

Get Selected Row Values

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 23 Apr 2012, 06:58 PM
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?

1 Answer, 1 is accepted

Sort by
0
Eric Klein
Top achievements
Rank 1
answered on 23 Apr 2012, 07:13 PM
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?
Tags
GridView
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Eric Klein
Top achievements
Rank 1
Share this question
or