Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid to Textbox

Status
Not open for further replies.

donnie4564

IS-IT--Management
Jan 12, 2002
129
US
Hi,
I am trying to use the datagrid with a select button to copy record to multiple textboxes. So, when user press select then that record is displayed in text boxes and from there sent back to sql. I have done this with a listbox but can't get anything to work with the DataGrid1_ItemCommand event. Please help if anyone has any ideas.

I'm using web application with vb.

Donnie
 
I got this already. Works!

Private Sub mydatagrid_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Handles mydatagrid.SelectedIndexChanged
Dim myid As Integer
Dim mycolumn1 As String
Dim mycolumn3 As String
myid = mydatagrid.SelectedItem.Cells(1).Text
mycolumn2 = mydatagrid.SelectedItem.Cells(2).Text
mycolumn3 = mydatagrid.SelectedItem.Cells(3).Text
mytxtbox1.Text = myid
mytxtbox2.Text = mycolumn2
mytxtbox3.Text = mycolumn3

Donnie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top