FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Row Positioning
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
xBrowse Row Positioning
Posted: Fri Apr 08, 2011 09:30 AM

Hi,

I have an xBrowse on a database, when i press space bar i open a dialog to view the record. When I return, i refresh the browse and make sure that the scopes are set and the data is up to date. I then return to the original record I was viewing. The problem is that when the browse refreshes, the record is highlighted correctly but always at the top of the browse. Is there any way of moving the browse to the same position before i call the external routine.

I've noticed that oBrw:nRowSel return the correct row number, i just need to know how to move the browse.

Best Regards,

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse Row Positioning
Posted: Fri Apr 08, 2011 11:03 AM
I've fixed it - not pretty but it sort of works

At the start of my routine

Code (fw): Select all Collapse
nRow   := oBrw2:nRowSel


At the end

Code (fw): Select all Collapse
        oBrw2:nRowSel := nRow   
        oBrw2:SetFocus()
        oBrw2:GoUp( nRow - 1 )
        SysRefresh()
        oBrw2:GoDown( nRow - 1)


If anyone knows of a better way, let me know

Regards,

Pete
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: xBrowse Row Positioning
Posted: Fri Apr 08, 2011 12:19 PM

Pete,

yes, would be interesting to have a ::rowOffset property to define start row to display

regards

Marcelo

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Row Positioning
Posted: Fri Apr 08, 2011 01:50 PM

When we show ( or edit ) a record in a dialog and come back to the xbrowse, xbrowse on its own does not disturb the display, unless we wrote some code before getting back to xbrowse which instructs xbrowse otherwise.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Row Positioning
Posted: Fri Apr 08, 2011 01:51 PM
Marcelo Via Giglio wrote:Pete,

yes, would be interesting to have a ::rowOffset property to define start row to display

regards

Marcelo

This can be achieved by assigning appropriate number to oBrw:nRowSel
Regards



G. N. Rao.

Hyderabad, India
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse Row Positioning
Posted: Fri Apr 08, 2011 02:34 PM

I tried this but it didnt seem to work - see above code how i fixed it

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Row Positioning
Posted: Sat Apr 09, 2011 05:35 AM
Mr Peter

When I return, i refresh the browse and make sure that the scopes are set and the data is up to date.

Please review this part of the code. In this part of the code, if you are not using any code that disturbs the xbrowse, when we return to xbrowse, the old row position is retained.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion