Link to home
Start Free TrialLog in
Avatar of jonzer12
jonzer12

asked on

DBgrid in delphi

Hello All,
I have a dbgrid connected to a datasource which points at a table.  I am trying to implement an edit field in which as you type the first few letters of a name will move the current table pointer to a record which begins with those letters, while still keeping the entire table in the dbgrid.  The only way I have done this so far is to use sql which only displays the results and not the entire table, can someone help?
Also I wish to sort the information in my DBgrid by a Lastname field, and not the key field, how is this done?

Thanks in advance,
Justin
Avatar of ILE
ILE

Exactly what u wont :))

on form is one  one edit componet and dbgrit,table and data source


procedure TForm1.FormActivate(Sender: TObject);

begin
  Table1.DatabaseName := 'DBDemos';
  Table1.TableName := 'Customer.db';
  Table1.Active := True;
  Table1.IndexName := 'ByCompany';
end;

procedure TForm1.Edit1Change(Sender: TObject);

begin
    Table1.FindNearest([Edit1.Text]);
end;



this is example taken from delphi
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ignore the last three lines above :-))
jonzer12:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept kretzschmar's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer