Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Failure to detect control value change
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01237100
Message ID:
01238583
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform