Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

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 VB.net.

Any ideas?
0
r270ba
Asked:
r270ba
1 Solution
 
MlandaTCommented:
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">
    <ItemTemplate>
        <asp:LinkButton runat="server" CommandName="Select" Text='<%#Bind("FieldToDisplay")#>'></asp:LinkButton>
    </ItemTemplate>
</asp:TemplateField>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now