Gridview rowupdating get datakey
01-Jul-2020 12:21
This little code snippet will help us to find the data keys assocciated with a row in Data Bound and Row Command event in codebehind file.
I have done this before "n" number of times but I am not able to get it working this time.
Hi, You can try the following code to implement the same.
Value) End Sub Regards, Manish wrote: I have a gridview that has a label field and a checkbox field in it. How can I get the datakey value that is assigned to that row when a checkbox is either checked or unchecked?
Value) End Sub Regards, Manish wrote: I have a gridview that has a label field and a checkbox field in it. How can I get the datakey value that is assigned to that row when a checkbox is either checked or unchecked?
We will normally set the primary key field to the Data Key Names property of Grid View control to identify the row.
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.
– ricky Programmer Feb 16 '15 at @ricky you may also use HIddenfield and set its value like Value=' | tenantcode - is not a number value | this answeredited Feb 16 '15 at Stephan2,95211029answered Feb 16 '15 at Karen414 Yes, you are correct tenantcode is a string, what can I do to correct it?
I know it works without the "Selecting" method but I cant recall how.
Hope this saves someone a full day of research (and possibly some hair)!
Hi, You can try the following code to implement the same.
Protected Sub Grid View1_Row Created(By Val sender As Object, By Val e As System. After working with Data Grids so efficiently, I was scared that Grid Views were going to be a million times more complex.