Re: Grid = Container Class behavior

Author: Abergquis@cs.com

Posted: 2000-08-31 at 10:17:44

Not so quick; check out my "DynamicCurrentControlSource" article in FoxPro

Advisor / February 2000 issue. The gist is to have two (2) separate controls

in your column, the only difference being the red label in one of them. Set

the column's Bound property to .F. and ResetToDefault() the column's

ControlSource (so that's it not set). Then set the ControlSource for each

control (i.e., the two [2] instances of your container] within the column.

Finally, at the end of your grid's Init() event/method, set Column1's

DynamicCurrentControl property by calling a custom "DynamicCurrentControl()"

method in which you place your If logic (alternatively, you can employ Do

Case logic if/when you have more than 2 cases) to determine which control to

display when.

(BTW, you can also set the DynamicCurrentControl property with an IIf

statement but I find it a *ton* easier to debug If and Do Case constructs in

a method than IIf methods *especially* when you have more than 2 cases.)

HTH,

Art Bergquist

abergquis@cs.com

In a message dated 8/30/2000 7:54:16 PM Pacific Daylight Time,

ahilton@usexpr.com writes:

> Yes, it's set to .F. That's the only way to get the container object to

> display at all in the column of the grid.

>

> The grid and container object therein have been working for almost 3 yrs

now

> (with other unrelated difficulties that I've had to work around) and I'm

> just trying to add this little user notification to one of the rows.

Thanks

> for the thought though.

>

> I believe Gopal explained it best. There really is just one object

reference

> and it is simply replicated over again for each row. There's no way to

> separate each container object based on row in the grid. I'll just have to

> notify the user in some other way outside of the grid.

>

> - A Hilton

>

> 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.

>

©2000 Abergquis@cs.com