I am loading the output of a database query to a DataGrid.
myAdapter.Fill(ds,"AllInfo");
dataGridSearchOutput.DataSource = ds.Tables["AllInfo"].DefaultView;
It will fillup the data grid control with multiple records. Suppose the primary key of the data record is "ID".
Now I want to generate report. To do that I need to select an item and click a button "Generate Report" or double click a record. Then a report should be generated for that ID.
My question is How should I capture the ID of the record? In otherwords I need to read the selected value in datagrid.