Using VB.Net
Windows application
Form (Gridview and Textbox)
GridView1
ID Name
001 Rajan
002 Sajan
103 Prathev
104 vijayan
....
Conditon
When i clicked the up and down arrow (keyboard) in the Gridview1 (id or name row), then selected cell should display in the textbox and also when i enter some numbers means, that entered number should appear in the textbox and
also entered related ID or name should display in the gridview1
For Example
If i press 0, that 0 should display in the textbox, and gridview display like
ID Name
001 Rajan
002 Sajan
If i press 1, that 1 should display in the textbox, and gridview display like
ID Name
103 Prathev
104 vijayan
Tried Code for displyaing in the girdview
Dim conObjects As New ConnectionObjects
conObjects.OpenConnection()
Dim cmd As SqlCommand
Dim ds As DataSet
Dim ada As SqlDataAdapter
cmd = New SqlCommand("Select ID, Name from employee where id like '%" & textbox1.Text & "%' ", conObjects.myConnection)
ada = New SqlDataAdapter(cmd)
ds = New DataSet
ada.Fill(ds, "employee")
gridview1.DataSource = ds.Tables(0)
Expected answer
-> In which gridview event i have to write a code
-> If i press up or down arrow, then selected cell should display in the textbox
-> If i enter some number or characters, that numbers or character should display in the textbox and selected related values should display in the gridview
How to do this.
Need help or vb.net code.
You can bind your
dataSourcetodataGridviewandTextBoxes.Here is sample code (Add dataGridView1, TextBox1,TextBox2):