Alpha Video Training
Results 1 to 10 of 10

Thread: Grid- how to display content of drop down box dynamic list from table in record order

  1. #1
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Grid- how to display content of drop down box dynamic list from table in record order

    New to the web side of things.

    I am populating a drop down box in grid with data from a dbf table. The default seems to be to order the list alphabetically and I cannot see an option for the order. I would like to be able to change this to record order or preferably be able to control the order using a different field that contains numbers allowing me the future ability to adjust the order if something new is added to the list.

    I've tried searching the forum and help but couldn't find anything.

    Hope someone can help.

    Cheers

    Geoff

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Geoff,

    Have you got a field with the value of the record number?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Hi Keith,

    Thanks for responding. No but I can add a field with a numeric value to order by. I just don't know how to implement an order based on it.

    I'm really struggling to piece to together information from the various help resources for web application. Videos are helpful but seem to have replaced detailed help documentation which isn't helpful. Maybe the information is there and I'm just not using the correct search terms. I have also been looking for an example of copying a field or record from a parent grid (when double clicked) to a child grid. It's probably easy as I imagine it is a common requirement but can't find anything. Do I use xbasic? is there an action script genie? Where does the code go? Is there a worked example available? Questions for another thread which I'm sure I'll be posting soon as I'm coming up with nothing at the moment. I'm surprised there aren't more example databases for the web included considering this is where they are putting most of the effort for new sales.

    It may start coming together once I have climbed the learning curve but at the moment I feel I'm lost in the wilderness which I suspect is a common feeling for those new to the software.

    Anyway any help you can provide is appreciated even if it is just steering me to the relevant help resource.

    Thanks

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Geoff,

    When you create the choices of the dropdown, you can set the order there.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #5
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Keith,

    I'm missing the obvious because I cannot see an input for the order. I have attached a picture of the set-up menu just in case we are looking at different things. Do you have an example (picture) of what/where to enter?
    Attached Images Attached Images

  6. #6
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Hi Geoff,

    Looks like you are correct, I cant see how to set the Order of a DBF lookup. I can do this with SQL.

    I know that does not help just at this time, but I was advised that all web development should be done with SQL type tables rather than DBF.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  7. #7
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Thanks Keith. At least I know I'm not going mad and the option doesn't exist.

  8. #8
    Member
    Real Name
    Jeff
    Join Date
    May 2008
    Posts
    149

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    While it may not be optimal, you can change your display value to an expression that includes the field that you want to order by, which will then order the drop down as you'd like.

    For example, a dbf table that contains the months of the year with fields for month_name and month_number would not be in the expected order if you set the display value to month_name, as it would start with April and end with September. To get around that, change the display value to an expression like
    Code:
    str(month_num,2,0) + "-" + month_name
    which will give you the correct order ' 1-January' through '12-December'.

  9. #9
    Member Tbrondolo's Avatar
    Real Name
    Tom Brondolo
    Join Date
    Mar 2006
    Location
    New York,NY
    Posts
    486

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Geoff

    What I found to be a very powerful method for drop down lists is to create the list in the OnGridExecute event, set the list to a string variable and then refernce the variable in the drop down. In this method you can have complete control over the dropdown list content and order.

    I also second the SQL only for WEB development advice. I started with .dbf's and soon switched everything to MYSQL, including security tables.

    tom

  10. #10
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Grid- how to display content of drop down box dynamic list from table in record o

    Thanks Jeff and Tom I'll look at both of your ideas and see which fits best.

Similar Threads

  1. Dynamic record list box
    By crimmelcp in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 05-23-2008, 05:15 PM
  2. setting the display order of a dynamic drop down
    By jopowers68 in forum Application Server Version 8
    Replies: 1
    Last Post: 08-18-2007, 11:55 AM
  3. Sorting Order in a Record List-List Box
    By Alan Lucas in forum Alpha Five Version 7
    Replies: 7
    Last Post: 02-27-2006, 07:20 PM
  4. table lookup / display as drop down list box
    By Daniel Weiss in forum Alpha Five Version 5
    Replies: 4
    Last Post: 11-21-2002, 08:57 AM
  5. Dialog Box Record List Display Order
    By fairviewcomputing in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-18-2002, 08:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •