Selecting a row ID from datagrid

  • Thread starter Thread starter romerve
  • Start date Start date
R

romerve

Hello,

I am interested on how to edit/view an item or record selected from a
DataGridView. The SQL queries for some data including the ID which is
not visible on the GridView.

I want to be able to click on the on a record from the DataGridView
then click the View Item and a form come up with information related
to that item. The View form with execute a query which will have the
(Select ..... Where ID="selectedItem.From.DataGridView")

Is there any way to get that done...?


Thanks
 
Well, yes, you have to initially select the data into the data grid
which has the id. The thing is, you can not auto-configure the grid at that
point, you would have to add the columns yourself, omitting the id. Then,
when you double click, you can check the data source for the current record
in the grid, and get the id so that you can populate your query.

Hope this helps.
 

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

Back
Top