| A TreeView of Data | ||||||||||||||||||
| How to display a dataset of records from a table/query in a treeview component. | ||||||||||||||||||
Article submitted by: Anand Gopalakrishnan for the Delphi Programming Quickies Contest.
This sample project uses one Page control, 3 TabSheets, 2 Combo Boxes, a BitBtn, Splitter, Memo, Listbox, Dbgrid and 2 Treeviews.
Usage of tabsheets on the pagecontrol: General tabsheet has the following treeview for structure definition which forms the base. Two ComboBoxes each for selecting the alias and table; as soon as they are selected, the fields of the selected table are displayed in the list box.
Dragging can be done from the list box on to the treeview for structure definition.
Thats all! After the structure is defined just click the "view data" button. Query statement is displayed in the memo just below the tree view. Switching tab sheets will show you the data view. Treeview items containing the record values filled from the table and then the grid view display of records in a DBGrid.
![]() Download Full source code! Of course, if you have any question please post and discuss on the Delphi Programming Forum |
||||||||||||||||||

