Click here to Skip to main content
16,005,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hie!

i am using gridview how can i do ....when i am clicking on gridview row that time all the data of that row will display in textboxes.



Please Help Me !
Posted
Comments
Sandeep Mewara 1-Jul-10 10:57am    
Winforms or Web application is it?
Npanchasara 2-Jul-10 0:22am    
Its a windows application in vb.net + ms access

Something like this?
Private Sub DataGridView1_RowHeaderMouseClick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick

   Dim sel as Integer
   Me.leftclick = (e.Button = Windows.Forms.MouseButtons.Left)
   If Me.leftclick = True Then
      
      sel = DataGridView1.CurrentCell.RowIndex
      Textbox1.Txt = DataGridView1.Rows(sel).Cells(0).Value
      .....
      'Or make a loop

   End If
End Sub
 
Share this answer
 
Comments
Ankur\m/ 1-Jul-10 8:28am    
OP asked for GridView (ASP.NET) and not DataGridView.
Scubapro 1-Jul-10 8:29am    
The Tag is VB.NET NOT ASP.NET
Ankur\m/ 1-Jul-10 8:33am    
I am sorry then. Let the OP confirm.
Npanchasara 2-Jul-10 0:21am    
Than you so much for Answer !

It works and i got mi result...........
Did you try searching Google?

Use "Select CommandField" to select a row and get the corresponding values. Do a search for the details. :thumbsup:
 
Share this answer
 
v2
Firstly tell us whether it is Web or Windows appl'n?

(For ASP.Net)
Then, do you want textboxes to display inside gridview on the selected row?
If yes, then you have to use ItemTemplate to put textboxes inside gridview.
Do some google search, you'll find many links on how to do this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900