For WebForms, take a look at DataKeys property in the DataGrid
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsbasedatalistclassdatakeystopic.aspI wish there was an equivalent for WinForms :(
>I have data in a recordset from a VFP table and display that data in an ASP.NET grid. I have a primary key for the table and need to keep track of it, but don't want to display on the screen. I setup the grid to have an extra column named "key" which holds the key value for the record. However, upon saving, I have values for all visible columns, but the invisible "key" column shows no value (the control does exist). If I change the column to visible, then the value is there the next time I populate the grid.
>
>How do I keep track of database columns for a grid without displaying them?
Hector Correa