C# and Return Datagrid Column Value

I have a Datagrid - dgSearchResults
I would like to return the value in the first column, MORTGEE_NUMBER

How can I do this via code?

Thanks,

JD
jamesdean666Asked:
Who is Participating?
 
burakiewiczConnect With a Mentor Commented:
these should work then
dgSearchResults.SelectedRows[0].Cells[0].Value;  
or
dgSearchResults.Rows[dgSearchResults.SelectedRows[0].Index].Cells[0].Value;
you can also use the column name

dgSearchResults.SelectedRows[0].Cells["MORTGEE_NUMBER"].Value;  
or
dgSearchResults.Rows[dgSearchResults.SelectedRows[0].Index].Cells["MORTGEE_NUMBER"].Value;
0
 
burakiewiczCommented:
dgSearchResults.Rows[x].Cells[0].Value

0
 
burakiewiczCommented:
or do you need all of the values from the column
0
 
jamesdean666Author Commented:
Just one column in the row, which will be selected in the datagrid.
0
 
jamesdean666Author Commented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.