Add lifebindings column runtime #2

Hello,

Is it possible to add a lifebindings column runtime?

The BindingsList has a TLinkGridToDataSource with the columns in it.
I want to create this list runtime and adjust the columnwidth to make it 
fit.

Thanks in advance
Herman
0
Herman
7/29/2015 1:36:34 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

2 Replies
989 Views

Similar Articles

[PageSpeed] 29

Try this:

{code}
var
  pLinkGrid : TLinkGridToDataSource;
begin  

  { create TLinkGridToDataSource }
  pLinkGrid := TLinkGridToDataSource.Create(BindingsList1);
  pLinkGrid.Name         := 'LinkGrid';
  pLinkGrid.GridControl  := myGrid;
  pLinkGrid.DataSource   := myBindSource;

  {add columns on grid }
  pLinkGrid.Columns.Add;
  pLinkGrid.Columns.Add;
  pLinkGrid.Columns.Add;
  pLinkGrid.Columns[0].MemberName := 'id';
  pLinkGrid.Columns[0].Header           := 'ID';
  pLinkGrid.Columns[0].Width             := 100;
  pLinkGrid.Columns[1].MemberName := 'name';
  pLinkGrid.Columns[1].Header           := 'Name';
  pLinkGrid.Columns[1].Width             := 200;
  pLinkGrid.Columns[2].MemberName := 'phone';
  pLinkGrid.Columns[2].Header           := 'Phone';
  pLinkGrid.Columns[2].Width             := 100;

  pLinkGrid.Active := true;
  
 end;
{code}

Remember  to associate a DataSet on your BindSource.
0
Maycoll
7/30/2015 1:14:49 PM
Thanks


Maycoll Trevezani schreef op 30-7-2015 om 15:14:
> Try this:
>
> {code}
> var
>    pLinkGrid : TLinkGridToDataSource;
> begin
>
>    { create TLinkGridToDataSource }
>    pLinkGrid := TLinkGridToDataSource.Create(BindingsList1);
>    pLinkGrid.Name         := 'LinkGrid';
>    pLinkGrid.GridControl  := myGrid;
>    pLinkGrid.DataSource   := myBindSource;
>
>    {add columns on grid }
>    pLinkGrid.Columns.Add;
>    pLinkGrid.Columns.Add;
>    pLinkGrid.Columns.Add;
>    pLinkGrid.Columns[0].MemberName := 'id';
>    pLinkGrid.Columns[0].Header           := 'ID';
>    pLinkGrid.Columns[0].Width             := 100;
>    pLinkGrid.Columns[1].MemberName := 'name';
>    pLinkGrid.Columns[1].Header           := 'Name';
>    pLinkGrid.Columns[1].Width             := 200;
>    pLinkGrid.Columns[2].MemberName := 'phone';
>    pLinkGrid.Columns[2].Header           := 'Phone';
>    pLinkGrid.Columns[2].Width             := 100;
>
>    pLinkGrid.Active := true;
>
>   end;
> {code}
>
> Remember  to associate a DataSet on your BindSource.
>
0
Herman
7/30/2015 1:21:48 PM
Reply:

Similar Artilces:

Add lifebindings column runtime
Hello, Is it possible to add a lifebindings column runtime? The BindingsList has a TLinkGridToDataSource with the columns in it. I want to create this list runtime and adjust the columnwidth to make it fit. Thanks in advance Herman ...

New Column in GridView which accumilative adds the totals from another column. #2
Hello everyone, I've tried to search for a solution on here but I've come up empty. Here is an example of my gridview   DATE     |     Amount    |01/06/08           2002/06/08           3003/06/08           1004/06/08           80 What I need now is a column next to Amount which accumilative adds the "Amount"...

ANN: Pascal Browser 2.2, adds support for Delphi XE7
Peganza Software has released version 2.2 of Pascal Browser, a Windows program that helps Delphi developers to document their source code. This version adds support for Delphi XE7 (all targets). In short, Pascal Browser is a Windows application that can: - create a hyperlinked collection of HTML documents and CHM file for your source code - help you understand and get an overview of your code - assist you in finding errors and anomalies in the source code - let new team members quickly get acquainted with the source code - let you create your own customized documentation Jus...

How to add 2 column values of a datatable 2 datavaluefield of a dropdown list
Hi, i want to append 2 column values to a datavaluefield of a drop down list. I found that in a dataset i can merge 2 columns and inturn bind this column to the datavaluefield. Is this the only way? Any ideas are appreciatedIf you keep your feet firmly on the ground, you'll have trouble putting on your pants! try  this...Consider you have following SQL Queryselect a,b,c from YourTableNameand you want to show a+b in one dropdown list...select a+b As NewColumnName, C from  YourTableNameand while binding data to dropdown, use NewColumnName...you will what you wanted...Please...

How to add a column during runtime?
I have a need to issue a change to the database - add a column to a table dynamically. This has to be done during the PB runtime (v5) via a powerscript to a SSA runtime (v5). What's the best way? TIA, YA In article <35FD5F35.1EC1@compuserve.com>, 73313.165@compuserve.com says... > I have a need to issue a change to the database - add a column to a > table dynamically. This has to be done during the PB runtime (v5) via a > powerscript to a SSA runtime (v5). What's the best way? > TIA, > YA > If your transaction object is maintaining a connection...

Ann: FastReport FMX for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Ann: X-platform report generator for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Add columns to datagrid in runtime
I am having a problem of adding a multiple templete columns to a datagrid. What i want to do is that whenever the user clicks a button a new templete column similar to the one in the exixting datagrid is added to that datagrid in rumtime. I am using th code Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim st As String Dim col As New TemplateColumn dt = Session("state") col = New TemplateColumn col = DataGrid1.Columns.Item(3) DataGrid1.Columns.AddAt(dt.Columns.Count - 2, co...

Add a column to the datawindow at runtime
hello I have a external datawindow, would like to add a column or a computed field based on the calculations required at runtime. Any ideas ? thanks Here are two ways ... ========================= Column ============================= <DW Control Name>.Modify(& "create column( id=<an integer> tabsequence=<an integer> accelerator='<a single letter>' moveable=<0 - False, 1 - True> resizeable=<0 - False, 1 - True> pointer='<Arrow!, Cross!, HourGlass!, IBeam!, Icon!, Size!, SizeNESW!, SizeNS!, SizeNWSE!, SizeWE!,...

Add LinkButton Column on runtime
How can I add a Linkbutton Column into a datagrid on runtime??? Not on design time but on runtime... Dim col As New ButtonColumn col.ButtonType = ButtonColumnType.LinkButton MyDataGrid.Columns.Add(col) Bug [MCSD] I think I need to add the column into a Dataset should i say dataset1.Tables(0).Add(......?.......) Moiz This is my code below, I am trying to get a value dr.getvalue(0) and place it in a Column called LinkButton which I set as a ButtonColumn. The value is being displayed on the grid but doesnt showup as a linkbutton, it shows up...

Add Column to External DW at Runtime
Hi, Does anyone know how to add a column to an external DW at runtime? Any help would be greatly appreciated. Thanks, Mike Yes, but it gets a little complicated. What you can do is export the datawindow to syntax, and use the syntax to rebuild (dw_1.create) the datawindow at runtime, adding statements to add columns. Be careful though, you need to check that the new syntax is right. I wrote an article demonstrating an offshoot of this on the fly datawindow technique, and you can downlaod the .pbl (it might be a little outdated, bu twhat the heck) at : h...

Gridview : how to add / remove column in runtime
Hi, i would like to add / remove grid columns based on a certain condition. Is it possible?thanks Hi~ You can first give the grid full columns, then use GridView.Columns.RemoveAt() to remove specific columns in condition~你好! Just FYI o_O Great. It works.thanks alot. I am facing the problem that the template fields added statically disappear when i remove a dynamically added bound field from a GridView  hi,i wanted to export my datagrid into an Excel file , ofcourse i didn't want the hidden fileds to appear in the file ( such as IDs columns ) when used ur metho...

add specific columns to the gridview at runtime
I configure the gridview's datasource at run time and set the AutoGenerateColumns property to False.  How do I add the specific columns to the gridview? thanks Try something like GridView1.Columns.Add(DataControlFieldValue). Randy Mr. Randy what do you mean by DataControlFieldValue? Is the name of the field in the stored proceure? thanks:) This is the column that you want to add. It has to be of the type DataControlFieldValue. You will have to build this control yourself. Take a look at msdn.microsoft.com and search on GridView, ASP.NET, 2.0, column and you should find ...

add 2 columns together in a datagrid?
How can I add 2 columns in one row together in a datagrid and display in another row the sum? I do not want to sum a column and display it in the footer. I cant do this in my Select statement it has to be done in the datagrid. thanx weisenbr <asp:Boundcolumn DataField="Field1" /> <asp:BoundColumn Datafield="field2" /> <asp:TemplateColumn> <ItemTemplate> <asp:Label id="Sum" runat="server" Text='<%#(Cint(DataBinder.Eval(Container.DataItem,"Field1")) + Cint(DataBinder.Eval(Container.DataI...

Web resources about - Add lifebindings column runtime #2 - embarcadero.delphi.firemonkey

Resources last updated: 12/18/2015 2:42:51 AM