Gridview rowupdating get datakey

Here's my situation : In a previous post ( I asked help to add a clickable image in a gridview.

The solution proposed in that post works and I did it, so I set that post resolved. I know that, usually, I need to use the Command Argument to retreive the index of the row, and then retreive different value, including the Data Key property (wich is the one I look for).

Here is what I am trying from the load event: Sub Bind Data() Dim my Connection As New My Sql. If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need. App Settings["ptcon"]; My Sql Connection conn; My Sql Command cmd = new My Sql Command(); Data Set ds = new Data Set(); My Sql Data Adapter da = new My Sql Data Adapter();protected void binddata() {conn = new My Sql Connection(co...

However, Command Arguments come from database to linkbutton. Passing Parameters from a Grid View Control I’ve been playing around with the Grid View and I trying to wire up a dropdown list when you’re editing.

gridview rowupdating get datakey-20gridview rowupdating get datakey-73

Actually, the only way I found to get something from the Command Argument parameter is to set it in the aspx page like this : In this exemple, DATAFIELD1 and DATAFIELD2 are data column.

After, I use the index as normal to access the Data Keys.

Hello, You can use the Click event of the linkbutton to get the row information from inside the gridview (if this is what you mean).

A table is recording the information except their mark. I also have another control that scans the DB at my workplace and pulls up the last 10 articles that have been posted to the knowledgebase and lists their titles and h...

There is another table recording the mark of the students whose foreign key is the primary key of the previous table. Datagrid(1.1) to Grid View(2.0) and using the Row Updating event how to extract the values from the controls. Gridview control in C#Hi , I am getting error (Object reference not set to an instance of an object.) while trying to update and delete the datas in gridview control.

Leave a Reply