Howdy, Stranger!

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

Categories

Sort table / dbgrid by lookup field

guy74guy74 Member Posts: 1
hi all,

i am trying to sort a dbgrid according to a lookup field, the index method does not work because i can't create an index for a look field.
my finaly objective is to create a dbgrid that have sort by clicking on the title of each column, including lookup fields

TIA,
guy

Comments

  • Slydog42Slydog42 Member Posts: 30
    : hi all,
    :
    : i am trying to sort a dbgrid according to a lookup field, the index method does not work because i can't create an index for a look field.
    : my finaly objective is to create a dbgrid that have sort by clicking on the title of each column, including lookup fields
    :
    : TIA,
    : guy
    :

    Hi, I've done something along those lines, but it was kinda fudged. I set the number of fixed rows in my dbgrid to 0, and then created a "fake" top fixed row, made up ACTUALLY of buttons. Upon clicking a button, the program would then string together a query with a different ORDER BY clause, and I would then requery and repopulate the dbgrid with the newly sorted data. I have just found out recently you can even keep your highlighted place in the grid (roughly) by keeping track of a toprow property.

    Hope that helps!
    Rusty
  • Andre YoungAndre Young USAMember Posts: 0

    _____ || http://forcoder.org || free ebooks and video tutorials about { Python, Go, PL/SQL, Objective-C, JavaScript, C++, R, Assembly, C, Visual Basic .NET, Perl, Ruby, Java, Delphi, Swift, C#, Visual Basic, Scratch, MATLAB, PHP Awk, SAS, D, Scheme, Ada, COBOL, Bash, Erlang, Crystal, Dart, VBScript, Julia, F#, Apex, LabVIEW, Lua, Prolog, Scala, ML, Fortran, ABAP, Rust, Alice, Logo, Kotlin, FoxPro, Hack, Transact-SQL, Lisp, Clojure } __

Sign In or Register to comment.