0

hello all.. i'm new ni vb.net
i need help. i got problem how to pass datagrid value to textbox.

i have two from. Form1 is textbox and form2 is datagrid.
what i want to do is to pass the selected value from datagrid(form2) to textbox(Form1).

im using vb.net 2003
thank you..

3
Contributors
4
Replies
9
Views
6 Years
Discussion Span
Last Post by vb.net beginner
0

you could save the value in the datagridview to a public variable and then access the variable from the other form. It will have the same value.

0

you can pass the selected rows of the datagridview cell vlue through on click of datagridview _cellClick event
like

dim id as Integer
id = Convert.ToInt32(datagridview.Rows[e.RowIndex].Cells["ID"].Value.ToString()))

//where ID is the name of the column.

Edited by __avd: Added [code] tags.

0

you could save the value in the datagridview to a public variable and then access the variable from the other form. It will have the same value.

Im not using datagridview. Im using DataGrid(vb.net 2003)..
thanks roottybrian

0

you can pass the selected rows of the datagridview cell vlue through on click of datagridview _cellClick event
like

dim id as Integer
id = Convert.ToInt32(datagridview.Rows[e.RowIndex].Cells["ID"].Value.ToString()))

//where ID is the name of the column.

Im using vb.net 2003.

this code i did:

Dim Aid, i As Integer
Aid = Convert.ToInt32(DataGrid1.CurrentRowIndex[e.RowIndex].Cells["Asset_ID"].Value.ToString()))

if i put e.RowIndex, my coding is error.

thank you pritesh2010

Edited by __avd: Added [code] tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.