ModifiedChanged of IModified

Answered
0
1

Hello,

 

I thought the Modified property is exactly what I need to find out if a User changed the contents of a Control. I created now a very easy example in WiseJ 3.0.8 with two controls:

public partial class Page3 : Page
{
    public Page3()
    {
        InitializeComponent();
        textBox1.ModifiedChanged += TextBox1_ModifiedChanged;
        dateTimePicker1.ModifiedChanged += DateTimePicker1_ModifiedChanged;
    }
    private void DateTimePicker1_ModifiedChanged(object sender, EventArgs e)
    {
        //Breakpoint1 here: look at dateTimePicker1.Modified
    }
    private void TextBox1_ModifiedChanged(object sender, EventArgs e)
    {
        // Breakpoint2 here: look at textBox1.Modified
    }
}

 

All the properties are the default except this.dateTimePicker1.Format = Wisej.Web.DateTimePickerFormat.Short;

Using this example shows following behavior:

  • leaving dateTimePicker1 without changing anything hits Breakpoint1 every time. dateTimePicker1.Modified is false
  • leaving textBox1 without changing anything doesn’t hit any Breakpoint.
  • leaving dateTimePicker1 after changing it’s content with the keyboard (default value is today (20.05.2022) and I changed it to 19.05.2022 ) hits Breakpoint1. dateTimePicker1.Modified is still false
  • changing it’s content with the calender control hits Breakpoint1 immediately with dateTimePicker1.Modified = true. Leaving the control afterwards hits the breakpoint again with dateTimePicker1.Modified = false.
  • leaving textBox1 after changing it’s content sets textBox1.Modified to true and hits Breakpoint2. The property stays true if I don’t manually switch it back.

1. I would prefer if these controls work kinda similar

2. I wish to find out if a user changes the date with the keyboard as well.

3. Am I supposed to change the Modified property manually to false again for Textboxes, to find out the next time the user changes it’s content?

 

Best Regards

  • You must to post comments
Great Answer
0
0

Hi Sascha,

Thanks for reporting this error, it will be solved in the next version.

Happy coding,

Kevin(ITG)

  • You must to post comments
0
0

Hi Sascha,

this issue is fixed in the latest Wisej release (3.0.9).

Best regards
Frank

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.