C# GridView from Code




I have two grid views on a page. Neither are directly bound from a
DataSource, they hold the results from user entered queries. The only
parameter I know that wil exist in the result set is an identity column. On
the 1st gridview I have a select button and I can test for it by using
e.CommandName=="Select". This works, however, I also have defined a
DataKeyName in the gridview, but I can't seem to access it from code. I have
tried GridViewRow row=gvResults.SelectedRow but I think I need the
SelectedValue, but I am lost. Any help would be appreciated.



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question