Re: Grid = Container Class behavior

Author: Abergquis@cs.com

Posted: 2000-08-30 at 17:59:41

Have you tried setting the column's Sparse property to .F.?

HTH,

Art Bergquist

abergquis@cs.com

In a message dated 8/30/2000 1:09:50 AM Pacific Daylight Time,

ahilton@usexpr.com writes:

> Does anybody have some ideas on this?

>

> I have a grid (my old nemesis!) showing records from a table in a database.

> I've made a class based on the container baseclass that I add to the grids'

> 1 and only column. The container class has several lables, textboxes,

> comboboxes, etc. This allows me to show multiple fields for each record in

> the table without the user having to scroll horizontally. This all works

> and is fine (with very frustrating limitations I've found in the past).

>

> I'm wanting to have one label on the container class turn to a red

forecolor

> when a field in the record is empty. I've tried doing this many ways but

> they all boil down to refreshing the grid which refreshes the container

> class which does something like...

>

> if empty(field)

> this.label1.forecolor = red

> else

> this.label1.forecolor = black

> endif

>

> Here's the problem: The label is only turning red when the focus is on the

> particular record that has an empty field (instead of doing it when the

> focus is on some other record that doesn't have the empty field in the

> record) AND *all* records' (3 or 4 records show at once on the form)

> container class labels turn red (not just the record that has the empty

> field).

>

> I want the label to turn red whether or not the focus is on that

> empty-fielded record AND for ONLY that label to turn red instead of ALL the

> labels turning red for each record.

>

> I've tried using the grids' setall method for Dynamicforecolor/backcolor to

> get a highlighted row as well but the container class covers up the entire

> row and won't show.

>

> So, did I explain the situation well enough and does anybody have a clue

> what I should try next?

>

> - A Hilton

>

©2000 Abergquis@cs.com