Focus CellEnter Event, DataGridView

S

SePp

Hi all,

I have three datagridviews filled by Datasets from a Database. I want
to give the user the ability to enter contacts to persons which work
in a company.

The first datagridview is the Company, then person and then contact
(like email etc)

If the user clicks into company datagridview he can see all the
persons which works in that company. If he clicks at a Person he can
see all the Contact addresses. All that should work with the
FocusCellEnter Event.


My problem:

Int32 PersonId =
Convert.ToInt32(dataGridView_person.Rows[dataGridView_person.CurrentCell.RowIndex].Cells["PERSONID"].Value);

Error:
Column named PERSONID cannot be found.
Parameter name: columnName


All that works with CellContentClick event, but sometimes the
CellcontentClickevent works not well and I want to try the
FocusCellEnter event.

This error occours straight after I started the Programm, so it looks
like the Event Occours but the datagridview is not intialized at this
time.... or something like that. (I have no chance to give the Focus)

Thanks in advance
SePp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top