If the click occurs in the Column Header the RowIndex will be -1. Try checking this before executing your statement: if e::RowIndex -1 set ws-protocolo to dataGridView1::Rows::Item(e::RowIndex)::Cells["Protocolo"]::Value::ToString() end-if
↧