Answer the question
In order to leave comments, you need to log in
"There is no suitable user-defined conversion." datagridview. What's wrong?
I'm deleting a row from a DataGridView on a button click, I don't know what the problem is
private: System::Void deleteBtn_Click(System::Object^ sender,
System::EventArgs^ e) {
for each (DataGridViewRow item in dataGridView->SelectedRows)
{
dataGridView->Rows->RemoveAt(item.Index);
}
}
Answer the question
In order to leave comments, you need to log in
SelectedRows is a DataGridViewSelectedRowCollection , and it only implements a non-generic IEnumerable that returns System::Objects when enumerated. So do for each (System::Object^ item in dataGridView->SelectedRows) and then cast to the row explicitly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question