Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello
I just want to ask how to get some part of the data from mysql in datagridview and onclick of that it will show me full data from database in next page.

thanks in advance
Posted

To you gridview add a button field column.

ASP.NET
<asp:gridview xmlns:asp="#unknown">
     <columns>
          <asp:buttonfield buttontype="Link" text="Edit" commandname="Edit" />
     </columns>
</asp:gridview>


In the code behind handle the row command event.
VB
Private Sub gridview_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles gridview.RowCommand
    If e.CommandName = "Edit" Then
        Dim iRowIndex As Integer = CInt(e.CommandArgument.ToString())
        Dim iId As Integer = CInt(grdParadeSignUps.DataKeys(CInt(iRowIndex)).Value)
        Response.Redirect("EditRegistration.aspx?ID=" & iId)
    End If
End Sub
 
Share this answer
 
click on the 'Edit Columns' option in 'GridView Tasks' then add a 'HyperLinkField' from the available fields and set its properties
 
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