Delphi 7 and TcxTreeView

ddudley3
ddudley3 used Ask the Experts™
on
Trying to get a node in a this Developer Express TreeView to be able to take more than 1 line so when I hit a key press like Shift Enter, it will add another line (like a CR LF)

Does anyone know how to do get this to work?  I've been looking for a while now using The Custom Control flags etc, but I can't find the right combination it seems.

Any help would be greatly appreciated !

Thanks
David
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
like this?

procedure TForm1.cxTreeView1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if (ssShift in Shift) and (Key = VK_RETURN) and Assigned(cxTreeView1.Selected) then
      if cxTreeView1.Selected.getNextSibling <> nil then
        cxTreeView1.Items.Insert(cxTreeView1.Selected.getNextSibling, 'New node' )
      else
        cxTreeView1.Items.AddChild(cxTreeView1.Selected.Parent, 'New node' );

end;

Author

Commented:
No that simply adds a new node under the tree..   I want more than 1 line in the node..


Like it would have
 
->Top Node
->New Node
    More of the same node
    More of the same node.
->Next Node
   + Child of Next Node
Top Expert 2010

Commented:
TTreeView and TcxTreeView can't draw multiline nodes. You have to draw it by youself. Here is the sample:

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_10595181.html#3160833
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Geert GOracle dba
Top Expert 2009

Commented:
or use the QuantumTreeView

Author

Commented:
What set of components is the QuantumTreeView in?
Oracle dba
Top Expert 2009
Commented:
it's a set on it's own
http://devexpress.com/Products/VCL/ExQuantumTreeList/

it's a Quantum Tree List by name

Author

Commented:
Be nice if they gave an example on how to implement
Geert GOracle dba
Top Expert 2009

Commented:
actually you would add a column with a memo field
then set it to show the full text
Geert GOracle dba
Top Expert 2009

Commented:
the quantumtreeview should have a onMeasureItem event
in this event you would give the measurements of each record

this event doesn't exist in the TTreeview and TcxTreeview

there is also a preview column
this column is put below the first line and can be multiple lines long
there really isn't any code
just set the property PreviewColumn

there is also a banded treeview, here you can have multiple columns on multiple rows
(basically no limits :) )
Geert GOracle dba
Top Expert 2009

Commented:
do you have a quantumgrid ?

you could simulate the treeview for a limited number of levels with group and detail grids

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial