Friday, November 30, 2007

Tip of the Day #5: Defining Hint Expressions for DB Grid Columns

Supported Versions:

R:BASE 7.6 for Windows (Build 7.6.2.31130 or higher ...)
R:BASE 7.6 (C/S:I) for Windows (Build 7.6.2.31130 or higher)
R:BASE Turbo V-8 for Windows (Build 8.0.16.1130 or higher)

Did you know that you can define a descriptive hint based on
an expression for a column(s) used in DB Grid.

Let's say you have a DB Grid for the InvoiceHeader table with
the following columns (See Figure 01):
http://www.rrbyw.com/DBGridColumnHints/figure01.jpg

. TransID
. CustID
. EmpID
. TransDate
. NetAmount
. Freight
. Tax
. InvoiceTotal

Now, if you would like to display a hint with the actual
Customer Name or Employee Name when mousing over the CustID
or EmpID, you can customize the CustID and EmpID columns,
using the new "Hint Expression" feature in the DB Grid
Column Properties.

. Form Designer | DB Grid Control | Properties | Columns
. Select the Column | CustID | Column Properties ...
. Column Properties | Hint Expressions

While defining the expression for selected column, you
can also customize the Hint Font and the Hint Background
Color, if you wish. (See Figure 02):
http://www.rrbyw.com/DBGridColumnHints/figure02.jpg

Save the form and use the form preview option to see
the results:

Notice the Company Name displayed as a hint for the
second Customer with CustID 127 (See Figure 03):
http://www.rrbyw.com/DBGridColumnHints/figure03.jpg

Notice the Employee Name displayed as a hint for the
second Employee with EmpID 102 (See Figure 04):
http://www.rrbyw.com/DBGridColumnHints/figure04.jpg

Imagine the possibilities!

Very Best R:egards,

Razzak.

P.S.
This entire sample application is also included with
2007 SAT Applications.
R:BASE 7.6: http://www.rupdates.com/RBG76SAT/
R:BASE Turbo V-8: http://www.rupdates.com/RBG8SAT/


Reply via email to