Hi HK33,
Although your question is quite "BAD" I try to start the guessing to work out what may be your problem. You are expecting someone to "work/think" for you, but you don't bother to formulate your question with a little effort - see OriginalGriffs comment. But with this "behaviour" you are not alone on this forum - I just can't get "used" to it...
That said, let's try to find your Problem:
I assume (those things you didn't think someone should know in order to help you):
* You use a
System.Windows.Forms.DataGridView
* You are using the
CellClick
Event of your
System.Windows.Forms.DataGridView
* Your exception happens when you try to get a cell with the indices you got from the EventArgs inside a CellClick handler (method)
So the trick could be just to add some logic to your handler.
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
{
}
else if (e.ColumnIndex < 0)
{
}
else
{
}
}
If this does not solve your problem try to improve your question and show the problematic/relevant code.
Kind regards
Johannes