I have a grid based on a cursor that contains the primary key of another
table which is related into the temporary table.

When displaying the grid, it correctly displays the columns from the real
table based on the relation.

However, if I select another form (form loses focus) and then click on the
grid, all the rows show the same values as the row I have clicked on. This
only happens the first time I open the form and do this. After this it is
fine.

If I click on any other column in the row, the grid fixes itself up to
display the correct rows.

I have put an explicit seek into the DynamicBackColor and
AfterRowColumnChange events to ensure that each row has the correct pointer
to the table but I don't think this is the problem.

Since the columns displayed are user selectable, it is not feasible to
include them all in the cursor.

Any ideas as to how to stop this as it is very annoying.?

Cheers
David

Cheers
David

Re: Grids with related column problem by Stefan

Stefan
Wed Apr 16 02:32:16 CDT 2008

Personally I prefer parameterized views as grid.RecordSource
because Set Relation in that context seems to produce various
"issues" - however, would this article help?
http://support.microsoft.com/kb/156030


hth
-Stefan

"David Younger" <david@theservicemanager.com> schrieb im Newsbeitrag
news:ODAb2s1nIHA.4832@TK2MSFTNGP02.phx.gbl...
>I have a grid based on a cursor that contains the primary key of another table which is
>related into the temporary table.
>
> When displaying the grid, it correctly displays the columns from the real table based on
> the relation.
>
> However, if I select another form (form loses focus) and then click on the grid, all the
> rows show the same values as the row I have clicked on. This only happens the first time
> I open the form and do this. After this it is fine.
>
> If I click on any other column in the row, the grid fixes itself up to display the
> correct rows.
>
> I have put an explicit seek into the DynamicBackColor and AfterRowColumnChange events
> to ensure that each row has the correct pointer to the table but I don't think this is
> the problem.
>
> Since the columns displayed are user selectable, it is not feasible to include them all
> in the cursor.
>
> Any ideas as to how to stop this as it is very annoying.?
>
> Cheers
> David
>
> Cheers
> David
>



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: Grids with related column problem by Dan

Dan
Wed Apr 16 11:07:33 CDT 2008

I'd go so far as to say I always regret *not* using a view in this
circumstance.

Every few years, a little voice asks "how bad could it be?" and then Foxpro
proceeds to answer that question. <g>

Dan

Stefan Wuebbe wrote:
> Personally I prefer parameterized views as grid.RecordSource
> because Set Relation in that context seems to produce various
> "issues" - however, would this article help?
> http://support.microsoft.com/kb/156030
>
>
> hth
> -Stefan
>
> "David Younger" <david@theservicemanager.com> schrieb im Newsbeitrag
> news:ODAb2s1nIHA.4832@TK2MSFTNGP02.phx.gbl...
>> I have a grid based on a cursor that contains the primary key of
>> another table which is related into the temporary table.
>>
>> When displaying the grid, it correctly displays the columns from the
>> real table based on the relation.
>>
>> However, if I select another form (form loses focus) and then click
>> on the grid, all the rows show the same values as the row I have
>> clicked on. This only happens the first time I open the form and do
>> this. After this it is fine. If I click on any other column in the row,
>> the grid fixes itself up
>> to display the correct rows.
>>
>> I have put an explicit seek into the DynamicBackColor and
>> AfterRowColumnChange events to ensure that each row has the correct
>> pointer to the table but I don't think this is the problem.
>>
>> Since the columns displayed are user selectable, it is not feasible
>> to include them all in the cursor.
>>
>> Any ideas as to how to stop this as it is very annoying.?
>>
>> Cheers
>> David
>>
>> Cheers
>> David
>>
>
>
>
>> \_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------



Re: Grids with related column problem by Stefan

Stefan
Wed Apr 16 15:04:50 CDT 2008


"Dan Freeman" <spam@microsoft.com> wrote in message
news:O1527v9nIHA.2208@TK2MSFTNGP04.phx.gbl...
> I'd go so far as to say I always regret *not* using a view in this circumstance.
>
> Every few years, a little voice asks "how bad could it be?" and then Foxpro proceeds to
> answer that question. <g>

... and Foxpro has a *deep voice and then the little voice gets
reduced to silence? <s>


-Stefan


Re: Grids with related column problem by Dan

Dan
Wed Apr 16 16:42:59 CDT 2008

Stefan Wuebbe wrote:
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:O1527v9nIHA.2208@TK2MSFTNGP04.phx.gbl...
>> I'd go so far as to say I always regret *not* using a view in this
>> circumstance. Every few years, a little voice asks "how bad could it be?"
>> and then
>> Foxpro proceeds to answer that question. <g>
>
> ... and Foxpro has a *deep voice and then the little voice gets
> reduced to silence? <s>

... accompanied by thunder and lightning! <g>

Dan



Re: Grids with related column problem by David

David
Thu Apr 17 01:06:10 CDT 2008

Thanx Stefan but I think this is the opposite of what is happening.

The relation is not being cleared.

Cheers
David


"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:eBbpGQ5nIHA.2208@TK2MSFTNGP04.phx.gbl...
> Personally I prefer parameterized views as grid.RecordSource
> because Set Relation in that context seems to produce various
> "issues" - however, would this article help?
> http://support.microsoft.com/kb/156030
>
>
> hth
> -Stefan
>
> "David Younger" <david@theservicemanager.com> schrieb im Newsbeitrag
> news:ODAb2s1nIHA.4832@TK2MSFTNGP02.phx.gbl...
>>I have a grid based on a cursor that contains the primary key of another
>>table which is related into the temporary table.
>>
>> When displaying the grid, it correctly displays the columns from the real
>> table based on the relation.
>>
>> However, if I select another form (form loses focus) and then click on
>> the grid, all the rows show the same values as the row I have clicked on.
>> This only happens the first time I open the form and do this. After this
>> it is fine.
>>
>> If I click on any other column in the row, the grid fixes itself up to
>> display the correct rows.
>>
>> I have put an explicit seek into the DynamicBackColor and
>> AfterRowColumnChange events to ensure that each row has the correct
>> pointer to the table but I don't think this is the problem.
>>
>> Since the columns displayed are user selectable, it is not feasible to
>> include them all in the cursor.
>>
>> Any ideas as to how to stop this as it is very annoying.?
>>
>> Cheers
>> David
>>
>> Cheers
>> David
>>
>
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>



Re: Grids with related column problem by Stefan

Stefan
Thu Apr 17 02:03:36 CDT 2008


"David Younger" <david@theservicemanager.com> schrieb im Newsbeitrag
news:ed4C%23EFoIHA.1236@TK2MSFTNGP02.phx.gbl...
> >
> > http://support.microsoft.com/kb/156030
>
> Thanx Stefan but I think this is the opposite of what is happening.
>
> The relation is not being cleared.
>
> <...>
>>>I have a grid based on a cursor that contains the primary key of another table which is
>>>related into the temporary table.

Is that cursor a "calculated" one, e.g. result of an "Select ... Into Cursor ..."
command?
If it is, would enhancing the Select-SQL with a "Join" to get rid of
the Set Relation construction be an option?

>>> When displaying the grid, it correctly displays the columns from the real table based
>>> on the relation.

So does the grid display columns from two aliases, i.e. parent and
child, and if so, did you set the grid.RelationalExpression, .ChildOrder,
.LinkMaster properties?

>>> However, if I select another form (form loses focus) and then click on the grid, all
>>> the rows show the same values as the row I have clicked on. This only happens the
>>> first time I open the form and do this. After this it is fine.
>>>
>>> If I click on any other column in the row, the grid fixes itself up to display the
>>> correct rows.
>>>
>>> I have put an explicit seek into the DynamicBackColor and AfterRowColumnChange events
>>> to ensure that each row has the correct pointer to the table but I don't think this is
>>> the problem.

Does that workaround cure the symptom but you do not like
it, or does it not help at all?


-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------