NumericUpDown oddities


Author
Message
Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
Hello All! Here's a puzzler:

As the user adjusts the bottom 6 fields, the repeat exposures are updated to reflect the total of all the repeat reasons.

As the Repeat exposures field is updated, the # Exposures field is updated to Repeats plus a base exposure (based on other settings on the form).

These updates are performed using a common event handler:

private void nudAllRepeats_ValueChanged(object sender, EventArgs e)
{
  txtRepeatExposures.Text =
Convert.ToString(nudEquipment.Value + nudMotion.Value + nudOther.Value + nudPosition.Value + nudTooDark.Value + nudTooLight.Value);
}

If i make changes to any of the repeat reasons and click the save button on the toolbar, the record is saved, but the form stays in Edit mode (the Save and Undo buttons remain enabled). If I click Save (or Undo) the form goes the proper state of Idle.

I've trapped the AfterSave event of the primary BO and checked all the other BOs on the form to see if their state is in edit mode, but all are idle.

Any ideas on why this is happening?

 


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
We ran into some strange occurances like this as well with some of our forms in the DDT.  Basically, you want to customize your business object to add the Field Property Changed events (either single event or unique event will do) and move your code from the nud.ValueChanged to the FieldChanged event of the field bound to that control.  Basically, the BindingContext of the form tries to refresh the controls when the data changes, which changes the controls, and it tries to push the data back to the business object causing it to become dirty.  So, just move your handler to the data and you should be good to go.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search