The Artima Developer Community
Sponsored Link

C# Answers Forum
DataGridView Selections

1 reply on 1 page. Most recent reply: Aug 29, 2008 12:01 AM by John D

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Fred Fowler

Posts: 1
Nickname: ffowler
Registered: Sep, 2007

DataGridView Selections Posted: Sep 20, 2007 1:34 PM
Reply to this message Reply
Advertisement
Hello All,

I am semi-new to C# and found things going pretty well. I have run into a problem where I have successfully populated a DataGridView but it just sits there. I cannot seem to find a way to retrieve the value in a cell that the user has selected, so it is pretty but useless.
Any help would be GREATLY appreciated.


John D

Posts: 2
Nickname: thewebhost
Registered: Aug, 2008

Re: DataGridView Selections Posted: Aug 29, 2008 12:01 AM
Reply to this message Reply
-If you are using VB.Net then try below code:

Dim dgvRow as DataGridViewRow

For Each dgvRow in DataGridViewName.SelectedRows

Debug.print (dgvRow.Cells(0).Value) ' Shows value form first column of each selected row
...

Next

Hope this helps..

Flat View: This topic has 1 reply on 1 page
Topic: get current URL from Internet Explorer Previous Topic   Next Topic Topic: Simple C# Help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use