For that Button You can keep one Button column in your DataGrid.
The click of button in that column will raise Datagrids ItemCommand event.In that event you can capture the particular row containing the button clicked, so that you can get all other column data for that row.
I think this sui for your requirement
Example code:
<asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 186px; POSITION: absolute; TOP: 136px" runat="server" AutoGenerateColumns="False" Width="190px" Height="220px" Runat="server" OnItemCommand="DataGrid1_ItemCommand" AllowPaging="True" DataKeyField="EmpCode">
<SelectedItemStyle BackColor="#FF8000"></SelectedItemStyle>
<Columns>
<asp:BoundColumn DataField="EmpCode"></asp:BoundColumn>
<asp:TemplateColumn>
</asp:TemplateColumn>
<asp:ButtonColumn Text="Update" ButtonType="PushButton" CommandName="Update"></asp:ButtonColumn>
</Columns>
</asp:datagrid>
CodeBehind:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Dim ad As New SqlDataAdapter("select * from Employee", "server=microsoftserver;initial catalog=winningworld;uid=
Dim ds As New DataSet()
ad.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End If
End Sub
Public Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
Response.Write("ItemCommand"
Dim id As String
id = DataGrid1.Items(e.Item.ItemIndex).Cells(0).Text
Response.Write(id)
End Sub