Check if datagridview has no selected rows
<p>I want to start a <code>Sub</code> by checking whether a datagridview row has been selected.</p>

<p>it's possible for there to be no rows at all. I have tried:</p>

<p><code>If isdbnull(lstInvoicesAndPayments.SelectedRows(0).Cells("DetailID"))= True Then</code> </p>

<p>but obviously if there is NO row, there is also no cell and I get an error.</p>