Can I use TBindSourceDB to bind data at runtime?

Dear all,

I'm using a TListView to show products, but the data is fecthed into a TFDMemTable at runtime because I want to show different fields for different categories. I plan to use a TBindSourceDB to bind the list view to the memory table at runtime, but I can find neither guidelines nor demo code to do that. Any suggestions?

Regards,
George
0
George
2/18/2015 1:42:48 AM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

5 Replies
2535 Views

Similar Articles

[PageSpeed] 20

I use this mode, may help you:

{code}
var
    BindSourceDB : TBindSourceDB;
    BindingsList : TBindingsList;  
    LinkListControlToField : TLinkListControlToField;
begin

    BindSourceDB := TBindSourceDB.Create(nil);
    BindSourceDB.DataSet := dataSet;  // -------> Here i use TFDQuery or TClientDataSet, but I believe that works with any descendant of TDataSet.
    BindSourceDB.DataSource.Enabled := true;
    BindSourceDB.DataSet.Active := true;

    BindingsList := TBindingsList.Create(FBindSourceDB);

    LinkListControlToField := TLinkListControlToField.Create(FBindingsList);
    LinkListControlToField.Control    := ListView;
    LinkListControlToField.DataSource := BindSourceDB;
    LinkListControlToField.FieldName  := 'field_name';
    LinkListControlToField.Active     := true;
end;
{code}
0
Maycoll
2/18/2015 6:44:16 PM
Maycoll,

I've tried your code, when it run to

{code}
LinkListControlToField.Active     := true;
{code}

it raised exception class EEValuateError with message  'Couldn't find SynchIndex'. What's the problem?

Regards,
George

> {quote:title=Maycoll Trevezani wrote:}{quote}
> I use this mode, may help you:
> 
> {code}
> var
>     BindSourceDB : TBindSourceDB;
>     BindingsList : TBindingsList;  
>     LinkListControlToField : TLinkListControlToField;
> begin
> 
>     BindSourceDB := TBindSourceDB.Create(nil);
>     BindSourceDB.DataSet := dataSet;  // -------> Here i use TFDQuery or TClientDataSet, but I believe that works with any descendant of TDataSet.
>     BindSourceDB.DataSource.Enabled := true;
>     BindSourceDB.DataSet.Active := true;
> 
>     BindingsList := TBindingsList.Create(FBindSourceDB);
> 
>     LinkListControlToField := TLinkListControlToField.Create(FBindingsList);
>     LinkListControlToField.Control    := ListView;
>     LinkListControlToField.DataSource := BindSourceDB;
>     LinkListControlToField.FieldName  := 'field_name';
>     LinkListControlToField.Active     := true;
> end;
> {code}
0
George
2/23/2015 1:04:40 AM
Try this:

{code}
LinkListControlToField.AutoActivate := true;
{code}
0
Maycoll
2/23/2015 5:01:28 PM
Sorry,

I tested this code and i got conclusion:

This works
{code}
LinkListControlToField.Activate := true;
{code}

Declare
{code}
Uses
   Fmx.Bind.Editors
{code}

I had not the same error that you. but only declare Fmx.Bind.Editors in Uses solved my problem.

One sugestion:

Create  bind in project time and verify which "Units" are necessary in clause Uses.

PS: Sorry by my terrible english ....
0
Maycoll
2/23/2015 6:21:41 PM
Maycoll,

At last, I appended Fmx.Bind.Editors, Data.Bind.EngExt, Fmx.Bind.DBEngExt to the Uses clause, it runs OK. Thanks a lot. 

George

> {quote:title=Maycoll Trevezani wrote:}{quote}
> Sorry,
> 
> I tested this code and i got conclusion:
> 
> This works
> {code}
> LinkListControlToField.Activate := true;
> {code}
> 
> Declare
> {code}
> Uses
>    Fmx.Bind.Editors
> {code}
> 
> I had not the same error that you. but only declare Fmx.Bind.Editors in Uses solved my problem.
> 
> One sugestion:
> 
> Create  bind in project time and verify which "Units" are necessary in clause Uses.
> 
> PS: Sorry by my terrible english ....
0
George
2/24/2015 3:46:31 AM
Reply:

Similar Artilces:

How can bind treeview using data base data and how can set sitemappath?
Hi friends   plz help me........Regards,Janardhana  Friend, here these articles are going to help you in binding a tree from database and sitemap navigation http://www.dotnetheaven.com/Uploadfile/danish.hameed/TreeViewControl07162005055926AM/TreeViewControl.aspx http://aspnet.4guysfromrolla.com/articles/113005-1.aspx http://www.ondotnet.com/pub/a/dotnet/2004/09/13/site_nav_aspnet20.html http://aspadvice.com/blogs/jfuentes/archive/2006/10/06/SiteMapPath-navigation-control-for-ASP.NET-2.0.aspx Hope it helped you. Good luck!  Please Don't forget to click "Mark a...

Late Data Binding/Data Binding at Runtime
I am using C#.  I created a master/detail webpage using a gridview and detailsview.  I have bind my gridview at design time.  However, once the user selects a record I want to bind my detailsview to another datasource that does not include all the fields in the gridview.  When I assign the datasource of the detailsview in the gridview's SelectedIndexChanged event handler, it does not display the detailsview.  What am I doing wrong?  Or is there any examples/tutorials I missed in msdn? I have looked at the following example in MSDN but does not give me enough...

What control can I use so I can lay my data fields any where on the screen and still bind it.
Can some one tell me if there is a control in vs 2008 that I can use to display for updates and have the data any where on the canves.  I have tried Data view, listview and they all had specific layout requirements. Thanks If you're talking ASP.NET then you're talking web pages and strictly speaking there isn't a canvas at all. Web pages contain sequential html elements whose positioning is defined, by default, by their order and nesting in the list of elements. You can override the default positioning by applying css rules. Most of the data display controls, GridView, D...

<%=Html.Select("State", ViewData)%> Can't bind to that data source. Consider using an IEnumerable data source such as an Array or collection
I cannot get this select to bind to a simple string array. [ControllerAction] public void OrderExample() { String[] states = new String[] { "AL", "AK", "AZ"}; RenderView("OrderExample", states); } Then in my View: <%=Html.Select("State", ViewData)%> Error: Can't bind to that data source. Consider using an IEnumerable data source such as an Array or collection It IS an array, ...

how to use business entities in business logic and data access layers when object data source is used?Here is my code can somebody pls help me in using business entities to select,insert ,update and d
Hi, I am new to dot net ,can someone please help me in how to use business entites in dataccesslayer and businesslogiclayer. I should not use dataset instead i should use business entites to get all the links,I am posting my code here,i am posting my business entites and dataaccess layer and business logic layer.Also I have a question regarding event handlers ,how to use that using grid view.Please can any reply as soon as possible.Here is the code:   Business Entities:  namespace UsefulLinkEntity { public class UsefulLinkEntity {public string strdp_Title...

Can I use DelphiGen to generate Delphi data-modules?
I understand you can customize the Delphi 3 templates that ship with AppModeler 6.1 to generate different *kinds* of Delphi forms, fields, etc. I wonder if it's possible to create a custom Delphi template set that generates a whole 'nother type of Delphi object: a DataModule. Instead of merely customizing one of the templates that AppModeler already ships with, this would involve creating a totally new *type* of template, and then "hooking" it into AppModeler's menus. It sounds like it can't be done, but I just had to ask. Even if you can't create...

I have a gridview that binds data from multiple tables, so how can I use the updatecommand?
Or what would be the best way to do an update? I have two dropdownlists that are databound and the rest of the items are bound from another table that has joins. When I do the update, what is the best practice? Should I rename the colums the same for all tables that join? I am confused. This is what I have working so far.    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="movie_id" DataSourceID="SqlGetMovieList" PageSize=&q...

Using data binding to save data
Hi, I have a question about whether Data Binding can facilitate the process of saving data in a web application. I learned that you can data bind information from a number of different data sources to controls such as TextBox, ListBox, etc. I am clear on the concept of data flowing from data sources into web forms controls. What I am not clear about is how to make the data flow the other way. When I am ready to save the changes or add a new record, can I somehow re-bind the data source and controls, so the data flows FROM controls TO the data Source? Here is a flow of events: ...

To display data we can use JSON return from WS, but what about edit a list of data and post back, what should be used on client side?
I remember there were a full client side demo back to the ATLAS age, I need edit a list of rows on client side, and post back when all done, What should I do in this case? thanks  Hi, The easiest method is using gridview in updatepanel. Please check out this link for more information: http://www.asp.net/AJAX/Documentation/Live/tutorials/UsingUpdatePanelControls.aspx Best Regards,Sincerely,Jin-Yu YinMicrosoft Online Community Support I use updatepanel in some places. It is good to save data without page post back. But what I need now is a way to do multi ...

"The system cannot find the path specified" using delphi xml data binding wizard
I am trying to create a binding for an xml file. As far as I can tell it is in the correct encoding and does not refer to any other files. It displays quite happily in IE8, EditPad Pro and the JVSimpleXML. Trying to create the binding I get the above error message with "Line:0". I have had the same message with other files, including xsd files. If I try to open the file from the explorer (or Explorer2 which I use by preference), I get a message "Windows cannot find the file...." before it displays in EditPad Pro. I am running Vista and wonder if it is a...

Whan can i do? make "string" data type convert to "window" data type, and use a "window" name to get it ancestor "window name", thanks! i use pb5
Rich, With a string window name, you can open a window of that type if you need to. You could, of course, query that window object for any attributes. Another option is to use the LibraryExport function to export the definition of the window which is specified by the string. You can then parse the resulting file to get information on the ancestor object. HTH Sanjiv. "Rich" <windows_ce@netease.com> wrote in message news:2Xsr1WW0AHA.178@forums.sybase.com... > > > ...

data.mdf files or tables?? i have almost 500 coulumname.. and records can be 1.000.000-3.000.000 in future for per month:) i can do 500/25=20... Should i use 20 different tables or 20 different data.m
hello friends  20 data.mdf files or  20 tables?? which one i select ?? i have almost 500 coulumname.. and records can be 1.000.000-3.000.000 in future for per month:) i can do 500/25=20 (because i have 25 main category and per category releated to 20 coulumname.. so 20x25=500)... Should i use 20 different tables or 20 different data.mdf files or 1 *.mdf with 1 table for high performance with searching, selecting, displaying gridview etc.??? if i divide 20 *.mdf, can i display all mdf filen in one gridview1 ? could you give me detailed information about this issue ? cheersMark ...

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen news:8703@forums.codegear.com... > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

Can Data feeds be used for B2B data manipulation?
Hi, I'm developing a web application as part of my dissertation and experimenting with RSS feeds to be used as a means to communicate/manipulate data between B2B websites. I want to know if it is possible to create a feed that collects specific data from a web form and updates the data on other databases of other users? Is this something very complicated? If yes what should I be using to automate the following process:  A system (which I'm going to be developing) is used to keep a record of all properties of a product, this product is also advertised on other third party w...

Web resources about - Can I use TBindSourceDB to bind data at runtime? - embarcadero.delphi.firemonkey

Resources last updated: 11/24/2015 7:58:13 AM