feature request tablegrid
Hi,
another idea to tablegrid.
If I use a tablegrid with several columns in deatailband it seems to be
wise to also use a tablegrid in the headerband to show the
corresponding columnheaders.
At designtime or via code I have to synchronize these two tablegrids
(for instance the column-width).
Wouldn't it be great to define only one tablegrid with two rows.
In the first row I put the header information (e.g. labels), in the
second row I put the data-controls.
In other words - there would be kind of a "Rowtype" which would be
"Header" for the first row and "Data" for the second row.
A headerrow shows only once (per page) and a detailrow is created for
each record.
Is this "understandable"?
What do you think about this, or is there a possibility to realize
something like this, already.
Best regards,
Josef Gschwendtner
--
another idea to tablegrid.
If I use a tablegrid with several columns in deatailband it seems to be
wise to also use a tablegrid in the headerband to show the
corresponding columnheaders.
At designtime or via code I have to synchronize these two tablegrids
(for instance the column-width).
Wouldn't it be great to define only one tablegrid with two rows.
In the first row I put the header information (e.g. labels), in the
second row I put the data-controls.
In other words - there would be kind of a "Rowtype" which would be
"Header" for the first row and "Data" for the second row.
A headerrow shows only once (per page) and a detailrow is created for
each record.
Is this "understandable"?
What do you think about this, or is there a possibility to realize
something like this, already.
Best regards,
Josef Gschwendtner
--
This discussion has been closed.
Comments
Thanks for the feedback. Yes, adding a Row property that specifies the row
is a header would be a great feature.
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
question:
When you have a table, you would usually need a header and table details.
I do it by using a tablegrid in the detail, but then I need another
table grid in the header (or group header) band, too.
It is then a pain to synchronize the width of each column, as these are
two separate tablegrids, especially when I need to add a new column (and
mess up the whole thing). I am thinking about synchronizing them in the
code.
How is the component designed to handle this typical scenario?
Thanks.
Dimitar
The RBuilder help topic for TppTableGrid includes details on both
design-time mouse actions and run-time properties and methods that can be
use to manipulate the grid, rows, cols, and cells.
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
You didn't answer my question. It was: is the Tablegrid designed to
handle both Header (which needs to be in a header band) and Detail
(which goes to the detail band)?
OR, do I need to have two grids, one in the header and one in the detail?
As I have explained, having two grids instead of one is inconvenient
because of the need to synchronize the columns between the two.
?? 1.01.2014 0:53, Nard Moseley (Digital Metaphors) ??????:
My name is Nard, I'm not the same person as Nico.
Yes, you need one TableGrid for the header and one for the detail.
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
;-) Thank you and sorry, I didn't pay attention.
Then, just for the sake of it, here's my solution, for everyone's benefit:
{grdHeader is obviously the grid in the header, grdDetail - in the
detail. Choose whichever grid should be changing the other's column width.
Use a BeforePrint method to set it, I use Report.BeforePrint
}
var i: Integer;
MasterGrid, SlaveGrid: TppTableGrid;
begin
MasterGrid:=grdHeader;
SlaveGrid:=grdDetail;
for i:=0 to MasterGrid.ColCount-1 do
begin
if i<=SlaveGrid.ColCount then
SlaveGrid.Cols[i].Width:=MasterGrid.Cols[i].Width;
end;
end;
What you COULD do is implement the above functionality, as it is really
simple, by a property of the TableGrid. Then you could "attach" one grid
to the other and automatically set the other grid's column widths.
-- Dimitar
much. We used few Shape components in place of TableGrid.
Regards,
Michael Chen
Thanks for the feedback. I added this on the requested feature list.
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Have received great feedback on the TableGrid - both praise for its current
power and ease of use and of course requests for additional features.
Using shapes frustrates most users (including me) and quickly breaks down.
The table grid allows visual editing at the row level, column level, and
cell level. And the cells are sophisticated containers - that can
automatically manage the size of their child controls and enforce inner
padding. Cells can be merged with cells above and below. Rows can
dynamically stretch their height - and the rows below shift downward
automatically.
The following is taken for the RBuilder Help Topic for TppTableGrid and
details the manipulations that can be performed via the Designer and a
second list that details how to do the same manipulations via code.
-------
TableGrid component used to print a table in a report. A table consists of
rows and columns that define a grid of cells. Cells may contain objects such
as Label, DBText, Memo, Image etc.
Use the RowCount and ColCount properties to specify the number of rows and
cols.
From the report designer, the following mouse actions are available:
Action Mouse
---------------------------------------------------------------------
select grid click inside edge of left, top corner
resize grid drag right-bottom sizing handle
resize grid width drag right-middle sizing handle
resize grid height drag bottom-middle sizing handle
select cell click inside a cell
multi-select shift-click each cell
select row click left inside edge of row
select col click top inside edge of column
resize col drag the column border
resize row drag the row border
The report tree can optionally be used to select grid, row, and cell objects
The grid context menu can be accessed by pressing the right mouse button
over any celll. The Row and Col items have subitems for Select, Add, Insert,
and Delete. The Cell menu item has subitems for Merge and Divide.
To access/modify a grid via code, the following properties and methods are
available:
Action Code
----------------------------------------------------------------------
access cells myTableGrid.Cells[RowIndex, ColIndex]
myTableGrid.Rows[RowIndex].Cells[ColIindex]
myTableGrid.Cols[ColIndex].Cells[RowIndex]
add rows myTableGrid.Rows.Add
myTableGrid.RowCount := myTableGrid.RowCount + X
insert rows myTableGrid.Rows.Insert(RowIndex);
remove rows myTableGrid.Rows.Remove(RowIndex);
myTableGrid.RowCount := myTableGrid.RowCount - X
move rows myTableGrid.Rows[RowIndex].RowIndex := X
add cols myTableGrid.Cols.Add;
myTableGrid.ColCount := myTableGrid.ColCount + X
insert cols myTableGrid.Cols.Insert(RowIndex);
remove cols myTableGrid.Cols.Remove(RowIndex);
myTableGrid.ColCount := myTableGrid.ColCount - X
move cols myTableGrid.Cols[ColIndex].ColIndex := X
Related Topics
TppTableRow, TppTableColumn, TppTableCell
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Hello,
is this feature available inbetween?
Best regards,
Mark
Row headers are not currently a feature of the TableGrid component. We
are still considering adding this for a later release of the product.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com