DataGridView CellEnter Focus Problem

22/01/2008 - 14:35 von SePp | Report spam
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);

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

Lesen sie die antworten

#1 Frank Dzaebel
22/01/2008 - 16:33 | Warnen spam

Du benutzt weder Deinen realen Benutzernamen als
Usernamen, noch schreibst Du deutsch, wie es in dieser
Newsgroup Usus ist.
Du erhöhst Deine Chancen, eine Antwort zu
bekommen, wenn Du die diese Sachen beachtest.

ciao Frank
Dipl.Inf. Frank Dzaebel [MCP/MVP C#]

Ähnliche fragen