Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShareData problem???

Status
Not open for further replies.
Jan 21, 2002
8
US
Hi all!

I'm having a problem with ShareData. I've done it before, but it was a long time ago! I am writing the app with PB6.5 and it appears to be sharing the data ok, but I have one dw (freeform) for maint and the other is a grid dw. I want the freeform dw to change when I select a row in the grid dw, but it's not doing it. Here's the details:

freeform dw is dw_1
grid dw is dw_2

In my window open event I have:

dw_2.SetTransObject(SQLCA)
dw_2.Retrieve()
dw_2.ShareData(dw_1)

In the clicked and doubleclicked events of dw_2 I have:

This.SelectRow(0, FALSE)
this.SetRow(row)
This.SelectRow(row, TRUE)

It is selecting the row fine in dw_2, but dw_1 is not changing. Can someone give me a hand? I think I'm having a brain fart! Thanks!!

Chris
 
In clicked/doubleclicked event for dw_2, just by setting row will not trigger setting row for dw_1. You will have to write some extra code for setting the row in dw_1 and also scrolling to the current row.

write the following code in the clicked/doubleclicked event after what you have already written.

dw_1.setrow(row)
dw_1.scrolltorow(row)
 
Hi,

dws do not automatically sync row-scrolling with other sharing dws (although this synchronizing should have been implemented in the ShareData() function itself).

Further, Clicked!/DoubleClicked! events are not the right place to synchronize row-scrolling in sharing dws. The right place to sync row-scrolling is the RowFocusChanged! event. If clicking/double-clicking involves rowfocus-change, RowFocusChanged! event fires, anyway. However, if we sync the row-scrolling from Clicked!/DoubleClicked! events, row-scrolling is forced each time these events are triggered although the rowfocus itself may not have changed.

Regards,


Scott
----------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top