Craig,
Have you set the datakeynames property of the grid?
After setting it I retrieve my key from the gridview using the row's index:
Dim ItemId As Int32 =
CType(GridView1.DataKeys.Item(GridViewRow.RowIndex ).Value, Int32)
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
<> wrote in message
news: oups.com...
>I have a grid attached to an objectdatasource from which just one field
> is editable.
> For the update method I have a method with two parameters, the key of
> the record and the column to be updated.
> However, what's happening is that I am receiving an empty key of the
> record in my update method.
>
> <asp:BoundField DataField="Key" HeaderText="Key" ReadOnly="True"
> SortExpression="Key" />
> <asp:BoundField DataField="AcceptReject" HeaderText="AcceptReject"
> ReadOnly="False" SortExpression="AcceptReject" />
>
> I notice that I I set Readonly False for the key expression, the
> parameter is correctly received in the update method.
> So, why should I have it editable in order to work ?
> Is there any other way to take this parameters to the update method
> without having to put my key in edit mode ?
>