Add columns to a TVirtualTreeView - c++builder-6

I am adding data to a TVirtualTreeView from a query, but I need to be able to add or remove columns according to the sorting parameters that the user decides.
In TListView, I am used to using this code to define columns:
TListColumn * pColumn;
pColumn = ListView1->Columns->Add();
but in TVirtualStringTree using TVirtualTreeColumn instead.
I've been looking for the help of this component but I can't find anything on how to define new columns. Could you tell me how to define new columns in this component?

Solved! I was trying to define a variable and it was not necessary. Simply add the columa directly to the tree.
VirtualTreeView1->Header->Columns->Add();

Related

grails 2 Add new column to f:table

I would like to add a new column with some static values like buttons and links to an existing tag in a view.
Is this possible? In the documentation, I can only find how to add or removes attributes that are part of the domain class. There doesn't seem to be a way to add a column with custom values. Ex: a button with a link to the "show" view and so on.
Looks like (unfortunately) there isn't a standard Grails way to do this.
I did manage to do this by using tables and loops ... to run the loop and then displaying the values using Grails variables. It would be great though if there was a standard Grails way to do this as it seems to be waste to first use a framework and then discard the scaffolding to write your own custom table!

Can I add type information to an ActiveAdmin attributes_table?

I want to make a table essentially like the attributes_table, but with a column showing the type of each field. I haven't found anything as convenient as attributes_table(:show_types) or attibutes_table do; column :type; ....
Is there a way to add such a column to attributes_table? If so, how? If not, what's the closest alternative?
Defining a custom Arbre component would be the best way to accomplish it, but it would not be trivial. Creating a customized subclass of AttributesTable would be a good starting point. Modifying the implementations of row, and build_colgroups would be required at the minimum.
One key thing to note is the component will require a unique builder method name like attributes_table_with_types_for.

How to add custom columns to grid items designer in FireMonkey

I have created a custom column TComboColumn = class(FMX.Grid.TColumn) for TGrid. Currently I have to add this column to grids in the code, but I would like to be able to do this using the TGrid items designer, like I can when adding default column types (TColumn, TStringColumn, TCheckColumn etc).
Possibly Tools API doesn't provide support...
Possible decision: to write and register own component editor (from TComponentEditor).
The report of this problem on QC: http://qc.embarcadero.com/wc/qcmain.aspx?d=107177

Add calculated column with checkboxes to datagrid

In my application I have a TcxGrid (devexpress datagrid) that displays the data returned from a stored procedure.
Now I would like to add a column showing checkboxes from which the values cannot come from the database but are calculated internally.
When the checkboxes are clicked, some internal logic needs to be triggered.
Any suggestions?
#boris, I recommend you use the Support Center site of DevExpress for this type of question, there are thousands of articles to DevExpress products.
Anyway I leave here a link to something that might help ;)
How to set up an unbound item in a data-aware View
Are you creating the view at runtime or at designtime?
I sort of cheated when I did this at runtime, and returned a static value as one column from my query:
select false as processed,col1,col2 from table where true
I could then safely attach the dataset, and I had my new column to play with.
You would then perhaps use the properties.onChange or properties.onEditValueChanged for your logic code.

What is the best way to print columns from different tables on the same row using the Axapta reporting tool?

It seems like each body section in an axapta report can only print columns from a single table(consistantly). For instance:
I have a report that has the following tables: SalesLine, InventTable and CustTable. Then I would like to print columns from each of this tables on the same row. It seems like I can do this when placing the fields in programmable sections but not when I place them in body sections.
I have found a few workaround that are either ugly or non-performant. There has to be a nice clean way to do this?
It should be possible to do this, there are several reports in the base system that work this way. Look at the SalesContractShipment report in 4.0 as an example.
On your report, create a datasource for SalesLine, and under that create datasource each for InventTable and CustTable. On InventTable and CustTable, make sure the FetchMode is set to 1:1. If you create a custom fetch method, make sure you call send() in the correct order. You should send CustTable first, then InventTable, then SalesLine last. On the report design, create a single body for SalesLine. You should then be able to use fields from any of the three tables in that body.
If you are still having trouble, I can think of two work arounds. One is to create a view based on those three tables, and create a report based on that view. The other is to create the report based on SalesLine and use displayMethods to lookup any fields you need from InventTable or CustTable.
You should be able to add multiple data sources to a report then create one body for the first data source that you added. Right-click the body and select New Control -> Field From AnyTableThatIsADataSource. You can then add any field that you want and it will print columns for all of those fields.
Put all the fields in the last SourceTable_Body and it'll show all the fields, because the QueryRun table by table and fill the body with each corresponding Body, so the last body will have all fields' data.
Consider using temporary tables. Fill it with your data first, than use in the report.

Resources