Solved

how to sort rows in grid using lookup field column?

Posted on 2001-06-11
7
339 Views
Last Modified: 2007-12-19
Hi,

Is there anyway to sort rows in grid using column that is based on lookup field?

The grid contains one lookup field that is pointing to the master file record ( i.e. EmployeeName ), I need to sort the rows based on the Employee's Name.  How?

Thanks
0
Comment
Question by:llkhor
7 Comments
 
LVL 22

Accepted Solution

by:
mnasman earned 50 total points
ID: 6176242
Hello

  If you want to sort ur data in ur grid, you need to do that in the dataset (table or query), for table, make an index in the field that u want to sort on, then from table property
IndexFieldName = anyindexfield u make

or u can use the query and order by to sort any field u like, in the query component sql text:
'select * from customer oder by company' if you want to sort ur data using the company field

also you can download some dbgrid from torry that could sort ur data
http://www.torry.net/db_grids.htm

Best regards
Mohammed Nasman
0
 

Author Comment

by:llkhor
ID: 6176586
mnasman :  I know both the methods you described, i am just curious if u could do sorting with lookup field (kind=fkLookup) instead.  

Thanks.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6176991
only with a query by including the field, which is referenced like

select a.*, b.lookupresultfield from tableA a, tableB b where a.lookupidfield = b.idfield order by b.lookupresultfield

in some databases b.fields must not be included into the fieldlist after the select in some other databases is this a must

meikl ;-)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:llkhor
ID: 6179607
Thanks for the feedbacks....  
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8451579
Upon review of the comments here, I am recommending this disposition:

        points to mnasman

Please post a comment if you disagree.

DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8492512
per recommendation.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now