Database displaying problems - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Database displaying problems

zapperonzapperon Posts: 88Member
I have the following problem. I have a self referencing table(table that points to itself). This structure is implemeted so that so that I can model an hirachical tree. I have to now display the data however in the way a directory structure is displayed. Following data used for example :

ID :Name :FK(Foreign Key)
=============================================================
1 :The Boss(Transport company) :NULL
2 :CEO :1 reports to(The Boss:1)
3 :Financial Manager :2 reports to(CEO)
4 :Labor Mnager :2 reports to(CEO)
5 :Transport Manager :2 reports to(CEO)
6 :The Boss(A internet company) :NULL
7 :CEO :6 reports to(The Boss:6)
8 :Financial Manager :7 reports to(CEO)
9 :Labor Mnager :7 reports to(CEO)
10 :Networking Manager :8 reports to(Financial Manager)

-1|
|-2|
|-3
|-4
|-5
-6|
|-7|
|-8|
|-10
|-9

There can many toplevel Entrys with x amout of subentrys. Now what would be the best way to displaying them ? Secondly how can I change or modify the text value displayed in a DBGrid before it is displayed on the DBGrid. Thirdly how can I make DRGrid column give the user a Yes/No choice where the base type of the field is an integer but it stores either a 1 or a zero and how to display this as true and false on a 1 or 0 but not on other values.

Any help will be appreciated.
Zapperon
[email protected]

Comments

  • PerranPerran Posts: 241Member
    [b][red]This message was edited by Perran at 2003-7-3 7:18:28[/red][/b][hr]
    : I have the following problem. I have a self referencing table(table that points to itself). This structure is implemeted so that so that I can model an hirachical tree. I have to now display the data however in the way a directory structure is displayed. Following data used for example :
    :
    : ID :Name :FK(Foreign Key)
    : =============================================================
    : 1 :The Boss(Transport company) :NULL
    : 2 :CEO :1 reports to(The Boss:1)
    : 3 :Financial Manager :2 reports to(CEO)
    : 4 :Labor Mnager :2 reports to(CEO)
    : 5 :Transport Manager :2 reports to(CEO)
    : 6 :The Boss(A internet company) :NULL
    : 7 :CEO :6 reports to(The Boss:6)
    : 8 :Financial Manager :7 reports to(CEO)
    : 9 :Labor Mnager :7 reports to(CEO)
    : 10 :Networking Manager :8 reports to(Financial Manager)
    :
    : -1|
    : |-2|
    : |-3
    : |-4
    : |-5
    : -6|
    : |-7|
    : |-8|
    : |-10
    : |-9
    :
    : There can many toplevel Entrys with x amout of subentrys. Now what would be the best way to displaying them ? Secondly how can I change or modify the text value displayed in a DBGrid before it is displayed on the DBGrid. Thirdly how can I make DRGrid column give the user a Yes/No choice where the base type of the field is an integer but it stores either a 1 or a zero and how to display this as true and false on a 1 or 0 but not on other values.
    :
    : Any help will be appreciated.
    : Zapperon
    : [email protected]
    :
    I was faced with a similar situation a while back. I downloaded a component that implemented a windoze tree control that was "data aware". It's a very nice component and handles all of the tree links in the background. Unfortunately, I'm blanking on the name and I'm writing this from my Linux box. Try a Google for "TDBTreeView" or variations on that. I might have gotten it from the components section of this site. Sorry I can't remember the details. HTH.


Sign In or Register to comment.