Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lookup table for DataGridView ComboBoxColumn
Message
De
07/10/2007 14:52:54
 
 
À
07/10/2007 06:04:24
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01258030
Message ID:
01259272
Vues:
20
Even in VFP I don't recommend using the columns hosted control's validating event. It has some odd behavior when the grid looses focus. VFP does not always properly call it. So it is possible to leave the grid without the control being properly validated.

So yes use the grid level CellValidating event. I just tested it and it works.

John


>John,
>
>>I think they will likely tell you it is by design. What it looks like to me is you are showing the form in the middle of the focus changing. The form is shown and actually flashes up in front, but then the focus change finishes and the form is moved back. Make sense?
>
>ComboBox OnValidating method is called BEFORE focus change.
>It must CANCEL focus change.
>If I place combobox directly to form OnValidating CANCELS focus change.
>If combobox is inside DataGridView, OnValidating does NOT CANCEL focus change.
>
>How to fix ?
>
>
>>The way to get around it is to prevent the focus from changing, this for instance works with your example code:
>
>Focus can be changed using mouse also. Your code does not work in this case.
>
>I'm experimenting with DataGridView OnCellValidating which seems to be called before OnValidating method.
>Maybe this can help.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform