O DataKeyNames, Where Art Thou?
The GridView control has a cool feature that allows you to bind more than one value as a DataKey. However, the documentation that I could find on how to get a DataKey other than the primary key was sparse. I finally discovered:
VB.NET
GridView.DataKeys(Index1).Values(
Index2)
C#
GridView.DataKeys[Index1].Values[
Index2
]
Where GridView is the ID of the GridView control, Index1 is the index of the row in the GridView, and Index2 is the name of the DataKey.
R