Thanks. I had seen that thread, but can't see why a datakey cannot be defined. In the past I have defined datakeys for gridviews based on the MS object data source and these have worked fine. I can understand that if no primary key is available in the database view then one cannot be determined by the TypedView, however should it not be possible to specify one?
I am using the typedView and a gridview to display purchase order header information. I then intended for the user to be able to click on a give PO header to drill down into the line items. Is there another way of acheiving this without obtaining a datakey following the RowCommand event? Should I not be using TypedViews?
My proposed code would have been:
protected void POHeaderInfo_RowCommand(object sender, GridViewCommandEventArgs e)
{
//check that the link has been clicked in the Action / View column
if (e.CommandName == "View")
{
//need to get the index
int idx = Convert.ToInt32(e.CommandArgument);
//now we can get the datakeys
DataKey dkey = POHeaderInfo.DataKeys[idx];
string PoID= dkey["PoheadId"].ToString();
}
}