mimou_2009
mimou_2009

Reputation: 47

AfterOpen TcxDBcurrencyEdit

I 'm using Delphi 7. I want to use TcxdbcurrencyEdit instead of using TDBEdit, but the probleme I didn't find the AfterOpen events when affecting my datasource to my component.

thanks in advance

Upvotes: 0

Views: 149

Answers (1)

MartynA
MartynA

Reputation: 30735

A TDBEdit does not have events like AfterOpen, AfterCancel, OnNewRecord - they are all events of a TDataSet, not a TDBEdit. So, if you want to access those you need to select your dataset in the Object Inspector, then click its Events tab.

Now that you've added some more explanation in your "answer", I follow what you're saying. In the Object Inspector, on the Events tab for a DBEdit, above OnChange, OnClick etc, there is a red label DataSource and if you expand it you can see a label DataSet and, if you expand that, you can see its events.

Where your confusion is arising is that I think you've missed the point that what the Object Inspector is showing you is just the DataSource connected to the TDBEdit (via its DataSource property on the OI's Properties tab) and the DataSet to which the DataSource's DataSet property is set. These DataSource and DataSet objects are the ones on your form (or datamodule if you're using one), and the red DataSource label of the DBEdit's Events tab is just a quick way of showing you relevant properties of them. If you want to inspect them in full, you just click them on the form as usual to select them for the Object Inspector. So, to see the DataSet's Event, just click it on your form and then click its Events tab in the Object Inspector. It's that simple!

Its true that there is no similar red DataSource label for a TcxCurrencyEdit, but that's just because its developers have chosen to omit that from what the Object Inspector shows - it does not mean that associated DataSource + DataSet and its events are missing.

[Original]

Assuming you have a TDataSet and a TDataSource on your form, to add a TcxDBCurrencyEdit all you need do is to drop one on your form, then, in the Object Inspector, click on the '+' sign next to its DataBinding property to expand it, then set its DataSource property to your DataSource and its DataField property to the name of your currency field.

Upvotes: 1

Related Questions