Hi TS,
As Brock has mentioned, in the current version of ASP.NET, the DataGrid's
DataKeyField is limited to single column field. However, if you do need to
save the multi-primary key info in the DataGrid's DataGridItems, we can use
some other means to workaround it:
We can make use of the webserver control's Attributes collection and put
each DataGridRow's primarykey info in a certain Attribute Item, like:
private void dgString_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("pk_value", "pk values from datasource");
}
}
Then, in the sequential update/delete events, we can retrieve those info
from the Item's corresponding Attribute.
Hope helps. Thanks,
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)