DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 18 Jul 2007 07:15:38 -0600,    posted on: microsoft.public.dotnet.framework.aspnet.datagridcontrol        back       

Thread Index
  1    eagle
          2    Eliyahu Goldin


Displaying the id/PK in a gridview?   
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. 
Example:

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.
Date:Wed, 18 Jul 2007 07:15:38 -0600   Author:  

Re: Displaying the id/PK in a gridview?   
Add "ID" to the DataKeyNames property and take out of the query.


-- 
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"eagle"  wrote in message 
news:%23tJC82TyHHA.4640@TK2MSFTNGP03.phx.gbl...

> 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. 
> Example:
>
> 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.
>
> 
Date:Thu, 19 Jul 2007 12:02:28 +0300   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us