Gridview - Change "Select" Column

I have just downloaded Visual Studio 2010 Web Express and need some basic help...

I have data from a SqlDataSource populating a grid view.  When the "select" column is selected, it then shows a details view.  This functionality is working fine.  The only thing I want to change is instead of having the "Select" column to display the DetailsView, I want to have one of the Sql columns to be "clickable" to display the DetailsView.

I am writing this in

Any ideas?
Who is Participating?
You could add a ButtonField with the DataTextField as the database table column you want to bind it to, and make the CommandName "Select"

OR use a templatefield
<asp:TemplateField HeaderText="My Column">
        <asp:LinkButton runat="server" CommandName="Select" Text='<%#Bind("FieldToDisplay")#>'></asp:LinkButton>

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.