Jump to content
Sign in to follow this  
dmitrybv

Demo project Samples\Object Pascal\Multi-Device Samples\User Interface\ListCollections\ListCollectionsSampleProject.

Recommended Posts

Hello.

 

When installing RAD Studio, the ListCollectionsSampleProject.dpr project is added to the C:\Users\Public\Documents\Embarcadero\Studio\23.0\Samples\Object Pascal\Multi-Device Samples\User Interface\ListCollections folder, which shows how to create and link collections to control TListBox.


How to correctly add the TBindNavigator component to the Form in this project so that you can use it to move through the list from the TListBox?


The TBindNavigator control has a DataSource property of type TBaseLinkingBindSource. But the Form does not have a component that would inherit from TBaseLinkingBindSource.

 

So TBindNavigator.DataSource cannot be assigned anything.


Although TListBox is supposed to communicate with data through a descendant of TBaseLinkingBindSource, the project uses the TBindList component.

But it cannot be assigned to the TBindNavigator.DataSource property.

Share this post


Link to post
Posted (edited)

Hi, 

Not sure I understand well, because this demo is, on my side (D12), a demo of Expression parser for live binding...

 

In fact, perhaps is is not really the subject, but if the problem is to link a dataset to a TListBox, I tryed just a week ago, and it was not very clear firstly, but now, I can do it quickly : Hope this will help you ?

 

- Drop your TListBox

- Drop your TClientDataSet (push a field or 2 inside) -> CreateDatSet

- Drop your TDataSource (but it's not a mandatory)

 

- In liveBinding, the "secret" is to link the 2 "Synch" parts : The one of the TClientDataSet with the one of the list. 

- then, link desired Field from TClientDataSet  into TListBox.Items.Text

 

Normally, you'll got a prompt that indicate it will create for you a TBindSourceDB and a BindingList with TLinkListControlToField.

 

Once this done, run and add record in your TClientDataSet, and it should appear in TListBox.

 

Hope this help, 

Vincent

 

- Above, my test app, starting only with Dataset and client DataSet, and a TPrototypeBindSource which is a more direct way (and fun) to display information.

image.thumb.png.57c2a831846642bcb1d15c7fa2bd3e6f.png

 

image.thumb.png.86dc8410c72d4b7a5313b1772b32cf22.png

 

 

 

 

 

Edited by Vincent Gsell

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×