Subject | Re: [IBO] lookupCombo in Grid, strange behaviour |
---|---|
Author | scronkey |
Post date | 2003-03-26T23:03:27Z |
Hi Helen,
thanks for your reply.
commented on refreshing the grid, because I noticed it had the same
outcome (The lookupCombo was refreshed correctly, but the entire
IB_Grid loses focus)
I also have noted that if I hit F5 (instead of a coded refresh), the
combo is correctly updated but the grid does NOT lose focus. (This
is the desired outcome)
I just cannot seem to find out why the grid loses focus when I do a
coded refresh.
grid loses focus when I have a hard-coded refresh on the dataset...
I cannot see anywhere any code that would make the grid lose focus
though.
I have found a work around, but I'm not sure if it is good practice.
Instead of having the DetailDataSet refresh straight after I change
the lookup key, I do the refresh in the AfterPost event.
This has the desired outcome (lookupCombo displays correct data &
grid still has focus)
But it seems a little over done to do a refresh in the AfterPost
event.
Has this foreseeable problems? If it does, maybe I could flag when I
have updated the lookup key, and only do a refresh in the AfterPost
when this flag is true.
Rgds,
-Ryan
thanks for your reply.
> So, are you calling Refresh on the grid, or the dataset?I'm aware I should be calling refresh on the dataset, I only
commented on refreshing the grid, because I noticed it had the same
outcome (The lookupCombo was refreshed correctly, but the entire
IB_Grid loses focus)
I also have noted that if I hit F5 (instead of a coded refresh), the
combo is correctly updated but the grid does NOT lose focus. (This
is the desired outcome)
I just cannot seem to find out why the grid loses focus when I do a
coded refresh.
>code) the
> As I recall, the action that you were doing was to change (in
> lookup key that was selected from the embedded lookupcombo. Indoing that,
> you invalidate the parent dataset row without the "knowledge" ofthe
> lookupcombo - so you need to call refresh on the dataset to getthe correct
> KeyDescLinks in the description column that is being sub-selectedby the
> parent query.That's exactly what I'm doing
>control focus
> By calling Refresh on the dataset, not only should the form's
> remain undisturbed, but you can specify that the current row andcolumn
> also remain the same, by using RefreshAction raKeepDataPos.I have tried this (raKeepDataPos), but the outcome is the same. The
grid loses focus when I have a hard-coded refresh on the dataset...
I cannot see anywhere any code that would make the grid lose focus
though.
I have found a work around, but I'm not sure if it is good practice.
Instead of having the DetailDataSet refresh straight after I change
the lookup key, I do the refresh in the AfterPost event.
This has the desired outcome (lookupCombo displays correct data &
grid still has focus)
But it seems a little over done to do a refresh in the AfterPost
event.
Has this foreseeable problems? If it does, maybe I could flag when I
have updated the lookup key, and only do a refresh in the AfterPost
when this flag is true.
Rgds,
-Ryan