xBrowse Row Positioning

xBrowse Row Positioning

Postby PeterHarmes » Fri Apr 08, 2011 9: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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse Row Positioning

Postby PeterHarmes » 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: Select all  Expand view


nRow   := oBrw2:nRowSel

 


At the end

Code: Select all  Expand view


        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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse Row Positioning

Postby Marcelo Via Giglio » 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
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: xBrowse Row Positioning

Postby nageswaragunupudi » Fri Apr 08, 2011 1: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse Row Positioning

Postby nageswaragunupudi » Fri Apr 08, 2011 1: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse Row Positioning

Postby PeterHarmes » Fri Apr 08, 2011 2:34 pm

I tried this but it didnt seem to work - see above code how i fixed it
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse Row Positioning

Postby nageswaragunupudi » Sat Apr 09, 2011 5: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 51 guests