Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 07, 2013 05:23 AM by Amy Peng - MSFT
Feb 21, 2013 07:27 PM|LINK
Using this bit of code to try and return the value for a DataKey from a gridview based upon a button click. But, instead of giving me the ID for the row clicked, it's returning the number for it's row. So, if I click row 8, I'm getting a value of 8, instead
of the StreamingID of the row of data in row 8. What am I forgetting to do?
...lots of sql... this is where I get my data:
reader = comm.ExecuteReader();
gvStreaming.DataSource = reader;
Then, on this button click, I never get the DataKeyName, it always returns the row number. ARGH.. very
btn = sender as
Feb 21, 2013 07:56 PM|LINK
Ah, found my answer on setting the datakeys in the codebehind..
Mar 07, 2013 05:23 AM|LINK
It is kind of you to share your solution to us.
If you have any other problem, welcome to post it in the asp.net forums.