This must be easy but I've drawn a blank so far.

I have a datagridview which I've populated manually (ie not data bound), and I've implemented some filtering functionality that hides rows meeting certain criteria.

The problem I have is that if I hide the last visible row I get an exception..."Current cell cannot be set to an invisible cell."

I can understand that, however it must be possible to have a datagridview without any rows, so what happens then.

How can I tell the datagrid that it hasn't got a current cell?

Any help much appreciated.