Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Failure to detect control value change
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01237100
Message ID:
01238583
Vues:
11
Hi,

>
>>I ran into the same problem. I wound up adding a few lines to the save button event to move the focus to the next control and back to the original control. That was the only way I could get the data to save.
>
>I took a closer look at this and it's inexplicable why it doesn't work properly. It's a bug inherent in Windows Forms that rears its ugly head under odd circumstances.

I think the problem arises because mmBusinessForm.EndEdit() doesn't look far enough to see if the ActiveControl is contained by a grid. Something like this works for me:
public override void EndEdit()
{
     if (this.ActiveControl != null)
     {
         if (!EndGridEdit(this.ActiveControl))
         {
             Control cntrl = this.ActiveControl as Control;
             if (cntrl != null && cntrl.DataBindings.Count > 0)
             {
                 this.BindingContext[cntrl.DataBindings[0].DataSource].EndCurrentEdit();
             }
         }
     }
//etc....
}
//////////////////////////////////////////////////
       private bool EndGridEdit(Control c)
        {
            ImmBindingDataGrid Grid = c as ImmBindingDataGrid;
            if (Grid != null)
            {
                Grid.EndEdit();
                return true;
            }
            if (c.Parent != null)
                return EndGridEdit(c.Parent);
            else
                return false;
        }
but I don't want to have to modify the MM assemblies if I can avoid it....
Best,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform