Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GridView Row Data to Label.text

Status
Not open for further replies.

JoeZim

MIS
Sep 11, 2003
87
US
I have the following GridView, with a button column:

Code:
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObligorSearchResultsDataSource" 
   <Columns>
       <asp:ButtonField ButtonType="Button"    CommandName="GetDetails" Text="Details"  />
   </Columns>
</asp:GridView>

I'm trying to get the value of the first databound column once the user clicks the button into my "Name.txt" label.

I'm using the following:
Code:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

        If e.CommandName = "GetDetails" Then
            Name.Text = ?????
        End If

End Sub

I've been playing around with this and cannot figure out how to evaluate the given row in the GridView when the user clicks the button column of that row.

Could anyone suggest a place to start?

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top