EndCurrentEdit called automatically

  • Thread starter Thread starter Milan Reznicek
  • Start date Start date
M

Milan Reznicek

I've found this topic "Trying to understand when EndCurrentEdit gets
automatically called" but no one answered it yet.

I'm in the same trouble - EndCurrentEdit is getting called automatically
when I set ((DataRowView) BM)["column"] = some_value;

Does anybody how to avoid the automatic call?

Thanks for any advice Milan
 
Milan said:
I've found this topic "Trying to understand when EndCurrentEdit gets
automatically called" but no one answered it yet.

I'm in the same trouble - EndCurrentEdit is getting called automatically
when I set ((DataRowView) BM)["column"] = some_value;

Does anybody how to avoid the automatic call?

Thanks for any advice Milan

I have discovered some new facts ;)

The situation is - We have our own control called DbTextBox which has
the ability to autobind to datasource and which stores it's unparsed
value (ints, floats, ...) inside so we just don't have to setup the
binding on every single form, .... When I leave the control so it's
looses focus the validating event occurs and our internal validator
parses and validates the input in .Text property and if OK it assignes
the internall cached unparsed value (respectivelly parses the .Text
input as beeing int or whatever and saves the value), and if binded to
datasource (even it's called DbTextBox could be used as unbinded to act
just as a validated TextBox) than we propose the changes to the binded
DataSource:

((DataView)
this.MyBinding.MyBindingManagerBase.DataSource)[this.MyBinding.MyBindingManagerBase.Position][this.MyColumnName]
= this.Value;

and here's the problem I encountered. When this line get's executed
BindingManager's Position property gets changed (because EndCurrentEdit
is called automatically - WHY???) - that would not be the worst because
after EndCurrentEdit it's normal to change the position is the data
changed the way that position in sorted data changed, the problem is
that happens this:
DATA
before the line:
SomeColumn 1
SomeColumn 2
....

my change:
SomeColumn 1 => foobar (sort is on SomeColumn 1 so i want the data to
change it's position)

after the line: (BM_PositionChanged occured)
data at original position
foobar
SomeColumn 2
....

data at new position - and this now stays as Current so data in whole change
foobar
SomeOtherColumn 2
....


I was thinking about it, spent yesterday debugging through it and
googling but didn't found anything at all.

Did anybody had the same problem, or does anybody see any huge mistake
in the code which i don't see. Thanks for any advice Milan
 
Back
Top