Solved

C# and Return Datagrid Column Value

Posted on 2008-06-23
5
503 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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