Gridview rowupdating datakey

Parameter name: index Another suggestion that failed, which I found online is: Dim action ID As Integer = Convert.To Int32(gv Office In I came across a similar problem before and after several attempt I reached the following observation: You can only access the visible fields. I will click on the EDIT link in one of the grid view row. I will update the values and click update link in edit mode and edit mode closes. At this point I need to capture the datakey of the updated row into some variable Can someone please help me out with this?"If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google , Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . unfortunately my solution won't permit me to hide the field in the background color. Thanks The OP has clearly mentioned the Row Updated event but if you'd like to suggest Row Updating - a page-level variable should be enough; beyond a postback a View State variable could be advised for the same page.

A datakey represents the primary key field or field of a record that can uniquely identify it in a data-bound control. Row Index represents the index of the particular row.

So I made this field visible and it worked with me.

(To hide it from normal users I changed the font color to mach the background color, reduced the font size to minimum) Stupid solution I know, but I hade to invent a workaround as soon as possible.

Buttons within a Grid View control can also invoke some of the built-in functionality of the control.

To perform one of these operations, set the Command Name property of a button to one of the values in the following table. Sets the Command Argument property of the button to "First", "Last", "Next", "Prev", or a page number to specify the type of paging operation to perform.

We can achieve the same functionality using Datakeys.

You must have an account to comment. Please register or login here!