Click here to Skip to main content
15,902,762 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i want to pass gridview values to form textboxes when am click on the edit button of gridview
Posted
Comments
Prosan 19-Jun-12 5:24am    
by js or code behind?

1 solution

Try Like This
VB
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
       If e.CommandName = "select" Then 

          Dim i As Integer
            i = e.CommandArgument()
            Dim row As GridViewRow
            row = GridView1.Rows(i)

           TextBox1.Text= row.Cells(1).Text
           TextBox2.Text = row.Cells(2).Text
            TextBox3.Text = row.Cells(3).Text
            
 End If

End Sub
 
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