Gridview - Change "Select" Column

Posted on 2011-04-21
Last Modified: 2012-05-11
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?
Question by:r270ba
    1 Comment
    LVL 30

    Accepted Solution

    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


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now