Re: GridView hide datakey



Sean,

Just delete the column and put the field name of your primary key (ie
CustomerID) in the GridView's DataKeyNames property. This can then be
referenced on postback. It also comes thru the GridView.SelectedValue
property when it has been selected.

HTH,
Chris

.



Relevant Pages

  • Re: GridView and TemplateField Help
    ... The DataKeyNames property of the GridView tells it which fields in the data that it's dealing with are the primary key fields. ... If yes, then the only slightly reasonable explanation that I can think of is the usage of System.Reflection by the GridView to invoke the Delete method, wherein it specifies the argument value as well as name, based upon what it has been passed in the DataKeyNames property. ... And I then get the error "could not find a non-generic method 'DeleteActivity' that has parameters: ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Gridview not updating the database
    ... It looks like you are not setting DataKeyNames property for the GridView. ... This property represents the primary key ... <SelectParameters> ...
    (microsoft.public.dotnet.framework.aspnet)