In .NET 2.0 datagrid (Not the DataGridView) we can select multiple rows from the
mouse and when we press delete button we can delete those rows from the datagrid.
I want to get those selected rows.
How can i do it ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Scott LyslePosted Jan 16, 2008, 11:51 PM
You'd said .NET 2.0 DataGrid; if you meant the DataGridView, there is a collection of selected DataGridViewRows:
foreach(DataGridViewRow dr in dataGridView1.SelectedRows) { MessageBox.Show(dr.Cells[0].Value.ToString()); }