At 03:57 PM 10/14/2010, Luc Delcoigne wrote:

... But the form I'm talking of is only to browse not to enter data.

Luc,

In that case ...

Did you know that you can customize individual row background and
font color using the DB Grid Row Background Color Field and Row
Font Color Field options of DB Grid Properties to achieve your goal?

Here's how:

    A quick tutorial to help you understand the basic concept.

01. Add two columns to the corresponding table with BLOB data.
    RowBackgroundColor TEXT 20
    RowFontColor TEXT 20

02. Create a form based on corresponding table with BLOB data.

    While in Form Designer, place "Enhanced DB Grid Control"

    Right-Click or [F11] for Enhanced DB Grid Properties

    Effects:

    Assign RowBackgroundColor column for Row Background Color Field.

    Assign RowFontColor column for Row Font Color Field.

03. Adjust all other properties as necessary.

04. Save the form and then close the form designer.

05. Create a quick command file as follows:

    -- Example 01
    UPDATE tablename SET +
    RowBackgroundColor = 'WHITE', RowFontColor = 'RED' +
    WHERE ColumnNameWithBlobdata IS NULL
    UPDATE tablename SET +
    RowBackgroundColor = 'WHITE', RowFontColor = 'GREEN' +
    WHERE ColumnNameWithBlobdata IS NOT NULL
    CLS
    BROWSE USING formname ...

    -- Example 02
    UPDATE tablename SET +
    RowBackgroundColor = 'SILVER', RowFontColor = 'BLACK' +
    WHERE ColumnNameWithBlobdata IS NULL
    UPDATE tablename SET +
    RowBackgroundColor = 'WHITE', RowFontColor = 'BLACK' +
    WHERE ColumnNameWithBlobdata IS NOT NULL
    CLS
    BROWSE USING formname ...

    -- Example 03
    UPDATE tablename SET +
    RowBackgroundColor = '[R124,G83,B23]', RowFontColor = 'WHITE' +
    WHERE ColumnNameWithBlobdata IS NULL
    UPDATE tablename SET +
    RowBackgroundColor = '[R169,G176,B209]', RowFontColor = 'BLACK' +
    WHERE ColumnNameWithBlobdata IS NOT NULL
    CLS
    BROWSE USING formname ...

06. Make sure to have fun!

Very Best R:egards,

Razzak.


Reply via email to