Asp net gridview rowupdating datakey
With a little bit of research, a lot bit of patience, and some help from the internet community, I was able to solve all my issues, and pretty elegantly at that. You can’t do something like Dim name As Hyper Link Dim inv As Text Box name = CType(Grid View1. in an actual post, just email me or comment somewhere and we’ll talk about it.Basically, I was trying to convert an existing data-display-only Grid View (ie, no special functions) into one where I can update a field, namely the inventory for displayed products. New Edit Index 'set to selected row Bind Grid View() ' your own subroutine that you use to bind your datagrid End Sub Protected Sub Grid View1_Row Canceling Edit(By Val sender As System.
Re-obtaining the List of objects via the utility method along with the index obtained from the event arg parameter is not an option because the List of objects may have changed.
After working with Data Grids so efficiently, I was scared that Grid Views were going to be a million times more complex.
I suppose my eyes got big when I saw all the new properties and methods, and wanted to try them all out. Most articles I found were for hardcoded datasources (especially on MSDN, ugh) and didn’t really help me much, so this post will be referring to Grid Views with dynamically bound datasources.
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.
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?