JVCL Help:TJvComboBox.Provider

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Used to select a provider as the control's source of data.


Pascal

 propertyProvider: TJvDataConsumer;


Description

The Provider property is used to link a data provider to the control.
Although you can select a provider directly in the Object Inspector, in code you should use the methods and/or properties provided by the consumer service the Provider property actually refers to.
If the selected provider (in combination with the attributes that apply for control) generates consumer services extensions (such as the IJvDataConsumerViewList but also provider specific settings for the control), any published properties for those will be added as sub properties of the Provider property in the Object Inspector. In code you should query for the extensions interface: if Supports(Provideras IJvDataConsumer, <interface GUID ortype>, <variable>) then
begin

 ...
end;
or: if Provider.GetInterface(<interface GUID ortype>, <variable>) then
begin
...
end;
You should first declare a variable of the type of interface you will request. Within the begin/end block you can then use that variable which will contain a reference to the interface requested.

When a provider has been selected, the Items property will retain its list of strings. Once you manipulate them (i.e. add or delete strings) the provider will be deselected automatically. Note that the Items property is also manipulated when you use DeleteExactString. You can read the Items property without the provider being deselected.
To retrieve the number of items you can use the GetItemCount function which will retrieve the correct number regardless whether a Provider is selected or not. Likewise, you can use GetItemText to retrieve the (display) text of an item from the Provider or the Items property.


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page