Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Data and Formatting in DBgrid

Status
Not open for further replies.

sytech

Technical User
Oct 27, 2003
14
0
0
GB
Hi All

I am quite new to Delphi and finding my way round I have an MS Access database which I need to run on individual machines so I have started rewriting this in delphi.

How do I limit the data displayed I have looked through help and can find no assistance on Queries what I have is a table through an ADO connection this is called Jobtable a DBGrid that displays Jobtable through a datasource, the Information I get is all of the information in Jobtable one of the columns in Jobtable is Customers, customers names can be spelt differently ie they are not on a lookup table as that would reduce data input speed and I do not need any other customer info, I need to display in db grid all those customers whose name begins with H or h and at runtime be able to change that to limit the returned records further, by additional chars i.e. Her, in access the query just used H* or Her*.

Also When I get the records I Need to format the display by colours to individual cells ie in jobtable I have a column called WindQty and a columm called WindProd for each row I need to format the Cell where WindQty > WinProd I want to colour the WindQty cell Red but if WindQty < WindProd colour it Green, I have found info in the forum on formatting the row but have been unable to limit this to individual cells.

A bit of code or other assistance would be greatly appreciated.

Thanks

Graham
 
faq102-2231

and

faq102-2416

both have code and examples for coloring the rows in a grid, you would just need to modify it to affect the specific cells.


HTH

leslie
 
Hi Leslie
Thanks I have tried those FAQ's and can get whole rows to change colour but I have not worked out how to change specific cells.

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top