Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 07:56 - May 21, 2007  

hugh

how to get the selected value of datagridview in textbox in vb.net 2.0

i want to get the selected value of datagridview in textbox in vb.net

plz help sooooooooooooooooooooooooooooooooooooooooooon

Categories

Answer Discussion
Tutorials

 

nidhi

Date:: May 22, 2007

Time:: 12:39

to help u get started, u can download a example from codeproject
http://www.codeproject.com/vb/net/grid10...
This probably doesnt directly answer your question, but its something Im throwing your way as part of learning how to use datagrids

nidhi

Date:: May 23, 2007

Time:: 01:44

Ok, here is how

pass in row,col to get a value of a cell
eg

mydatagrid(iRow, iCol)


Use the CurrentCell method to get the rownumber and columnnumber

eg I have a datagrid called DataGrid1

mytextbox.text = DataGrid1(DataGrid1.CurrentCell.RowNumber, DataGrid1.CurrentCell.ColumnNumber)

nidhi

Date:: May 30, 2007

Time:: 05:32

Hi Hugh, any luck with this? Are u still getting problems?

admin

Date:: Jul 02, 2007

Time:: 09:54

hugh, please close this question and distribute the points.
If you didn't get a solution to your problem or you found it yourself, please leave a comment here to let the experts know.
Thanks,
Quomon Admin

admin

Date:: Aug 17, 2007

Time:: 11:54

The question has been closed.

The Quomon Admin Team

liam1023

Date:: Jun 04, 2008

Time:: 13:56

It appears there is no rownumber or columnnumber property for a datagridviewset, it's columnindex and rowindex and the order is columnindex first then rowindex.

Question Answered

This question has been closed, and points have been rewarded to the following experts:


nidhi: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

volvonilesh

Date:: Oct 16, 2009

Time:: 02:59


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

ranjithmacxster

Date:: Mar 07, 2010

Time:: 11:39

Dim i, j As Integer
i = DataGridView1.CurrentRow.Index

txtname.Text = DataGridView1.Item(0, i).Value
txtaddress.Text = DataGridView1.Item(1, i).Value


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

eulins8

Date:: Mar 08, 2010

Time:: 21:02

when you select 1 cell, show your value in a textbox

txtname.Text = DataGridView1.CurrentCell.Value


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

eulins8

Date:: Mar 08, 2010

Time:: 21:04

when you select 1 cell, show your value in a textbox

txtname.Text = DataGridView1.CurrentCell.Value


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

eulins8

Date:: Mar 08, 2010

Time:: 21:15

to see the value of a cell to click on this and shown in a textbox

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

Dim x As String
x = DataGridView1.CurrentCell.Value
MsgBox("Cell:" + x)

End Sub


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

hit.jariwala

Date:: Jul 21, 2010

Time:: 11:41

But how can i pass value other form
whitout using form.show() method.


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

ndumajoka

Date:: Nov 29, 2010

Time:: 06:58

Guys, i want to obtain label values within a datagrid; please have a look at my code, and it gives me errors:

Dim title As New DataGridItem(DirectCast(VideoDetailsView.FindControl("lblTitle"), Label).Text())


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

haladag

Date:: Mar 16, 2011

Time:: 11:39

to get value of the first cell(customerID) of the selected cell in row in datagridview and to display in texbox different form iam using visual studio
thank you


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

info5

Date:: Jul 01, 2011

Time:: 16:33

textbox.Text = Me.DataGridView1.CurrentRow.Cells(0).Value
'textbox= every thing like textbox or label for show the data
'datagridview1= every data grid


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

romiltonfdo1

Date:: Oct 12, 2011

Time:: 05:23

For Each row As DataGridViewRow In datadv.SelectedRows
 txtbox1.Text = row.Cells("Slno").Value.ToString()
 txtbox2.Text = row.Cells("Name").Value.ToString()
Next


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es