I seem to get inconsistent behaviour when assigning a value to DBEdit components. (DBEdit.Text := 'New Text') Occasionally they show in display, mostly do not. And, they never seem to change the underlying database.
Any text typed by the user works fine. The only way to make assignment in code work is to assign the value to underlying datafield. (i.e, DBEdit.Datasource.Dataset.FieldByName(DBEdit.FieldName).AsString := 'New Text' works fine. But, isn't that an overkill ?)
A look at the VCL shows that the assignment is executed via the private "SetText" method of TCustomMaskEdit component (which is the ancestor of TDBEdit). Two questions:
1. Why didn't Borland/CodeGear/mbacardaro add an inherited SetText method to the TDBEdit component ?
2. Can one add SetText method to the TDBEdit component, which simply would set the underlying datafield and then call the inherited method ? (presumably, VCL has be be tweaked to make the inherited method accessible). Are there any known side effects to this?
Oh, by the way the TDBCoboBox is also a mess, when it comes to assignment via code :-)