DataSourceUpdateMode

Answered
0
0

Hi guys,

It seems to me there is no difference in a textbox’s binding  for DataSourceUpdateMode.OnValidation and DataSourceUpdateMode.OnPropertyChanged. In both cases the property’s set method fires when the textbox loses focus. Is this the expected behaviour? Shouldn’t it fire whenever a char is typed in the case of OnPropertyChanged? Or I’m missing something fundamental?

Best,

Alex

  • You must to post comments
Best Answer
0
0

Hi Alex,

In one case the data source property is updated when the bound property changes, in this case Text. Otherwise, it updates it when the control fires the Validated event. For the TextBox, the Text property changes when there is an event sent to the server (any event). The KeyPress, KeyDown, etc. events are not sent unless your code subscribes to one of the events. See lazy events: https://wisej.com/docs/html/Events.htm

HTH

  • Alex Prinias
    I was indeed missing something fundamental, in fact when I read it I remembered having seen it once in the past. After registering a KeyUp event it does work as expected. Thank you, Luca! Alex
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.