Solved

C# and Return Datagrid Column Value

Posted on 2008-06-23
5
500 Views
Last Modified: 2013-11-26
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
0
Comment
Question by:jamesdean666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:burakiewicz
ID: 21848308
dgSearchResults.Rows[x].Cells[0].Value

0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 21848397
or do you need all of the values from the column
0
 

Author Comment

by:jamesdean666
ID: 21848528
Just one column in the row, which will be selected in the datagrid.
0
 
LVL 16

Accepted Solution

by:
burakiewicz earned 500 total points
ID: 21848615
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
 

Author Closing Comment

by:jamesdean666
ID: 31469854
Thanks.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question