I have a DataGridView which takes values from the DB. Now I want to print out only the Selected Items which user has selected from the UI. This is what I did if the user wants to print out whole table in DataGridView:
var dataTable = dataGridView1.DataSource as DataTable;
Now I am trying to use the SelectedCells property in DataGridView. Cant get it though :-(
var selecteditems = dataGridView1.SelectedCells as DataTable;
What I am doing wrong here? All I want is to put my selected cells into a DataTable.