You wouldn't use "hasfocus" because there is no such thing. Please provide a FULL and CLEAR explanation of what you're trying to achieve. Descriptions that are vague or downright wrong don't help us help you.
The mouse cursor has nothing to do with focus. I emphasised "FULL" and "CLEAR" for a reason. Do you want to do something when the mouse pointer enters a cell or when a cell receives focus?
That said, either way, you're going to be handling an event and putting code in the event handler. You should be able to look at the events available for the DataGridView control for yourself and pick the right one to handle. Any events related to specific cells have names that begin with "Cell", so they're easy to identify.
I have my doubts whether that's actually true, unless you you described your requirements even more poorly than I thought. It may appear to do what you need but I suspect that, at the very least, there is a better way. It's up to you whether you want to find out whether or not that's the case.