Displaying the id/PK in a gridview?

Discussion in 'ASP .Net Datagrid Control' started by eagle, Jul 18, 2007.

  1. eagle

    eagle Guest

    So how does everyone hide the primary key in a gridview with a datasource to
    a table, let's say. If you don't display it, then you can't update the
    records. Users don't want to see this field, particularly if it's a guid.

    Select ID, ProductName from tblProducts is the datasource

    The gridview has 2 bound fields, the id and the productname. If you set the
    id to invisible, it's not rendered and it is lost when you attempt to update
    that record.
    eagle, Jul 18, 2007
    1. Advertisements

  2. Eliyahu Goldin, Jul 19, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.