treeview format problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coolminded
    New Member
    • Mar 2007
    • 137

    treeview format problem

    hi,
    i have used tree view in my application and i have used only upto 3 levels in it. i'm using vb6 and postgres. how could i display all the content of the tree view so that it will display as 1.1,1.2 and so on.
    now it displays like
    1.1
    1.10
    1.11
    1.12
    1.13
    :
    :
    :
    1.18
    1.19
    1.2
    1.20
    1.21
    1.22
    :
    :
    :
    1.3
    1.30
    1.31
    and so on with the child on every head

    i want to display it serially not like the format above, i have used order by clause , but it didn't work.

    could anybody suggest any solution for this.
    thanx
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    I guess our 1.1, 1.12... are Text fields, so OrderBy gives you Textual Order..
    So you need to convert it to Numeric and Order By..

    In Access, we use Order By Val(MyFields)

    In PostgreSQL, you have to use To_Number..
    something like this :
    ORDER BY to_number(MyFie ld, text(99999999))
    ( I got the by googling)

    Regards
    Veena

    Comment

    • coolminded
      New Member
      • Mar 2007
      • 137

      #3
      hi veena,
      it doesn't help me what u have advised to me. because first of all i have 4 root levels.
      1
      2
      3
      4.
      for each root level, there are many child nodes, like
      1.1
      1.2
      1.3
      ..
      ..
      1.9
      1.10
      1.11
      ..
      ..
      2.1
      2.2
      ..
      ..
      2.9
      2.10
      2.11
      2.12
      ..
      ..
      and so on for 3 and 4 root level respectively.
      when i use the clause
      "select column_name from tbl_name order by to_number(colum n_name,text(999 9999))"
      it still displays like
      1.1
      1.10
      1.11
      ..
      ..
      2.1
      2.10
      ..
      and so on

      how could i get these on ascending order.
      can anybody else help me to do so?

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Post your code here..

        Regards
        Veena

        Comment

        • coolminded
          New Member
          • Mar 2007
          • 137

          #5
          Originally posted by QVeen72
          Hi,

          Post your code here..

          Regards
          Veena

          hi veena,

          my select query is as

          "select column_name from tbl_name order by to_number(colum n_name,text(999 999))"

          with regards

          Comment

          • lotus18
            Contributor
            • Nov 2007
            • 865

            #6
            Originally posted by coolminded
            hi veena,

            my select query is as

            "select column_name from tbl_name order by to_number(colum n_name,text(999 999))"

            with regards
            Post your codes not the query : )

            Rey Sean

            Comment

            Working...