Previous Thread
Next Thread
Print Thread
XTREE: Focus Row #35068 22 Mar 22 07:15 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Good day -

How about a nice xtree question to deviate from world events? crazy

I am having difficulty regaining focus on an editable row after an click event.. and i am probably overthinking it now that its been a couple days.

I have a grid that is sorted by a particular column. After a right or left click event on another row, i cannot get the grid to keep focus on the row that was clicked on. Simple scenario is i have a display row=10 which is logical row=36. I right or left click on this row from 1 edit the field and re-enter the grid it redisplays on DISPLAY ROW 36. SO i guess to KISS - what values do i need to have in the xtr'xrow and/or xtr'targetrow in order to keep the grid static on the screen and not display row 36. I am reloading xtree using opcode=1 after the edit event. I am setting xtf'noredraw.

TIA.

Re: XTREE: Focus Row [Re: Frank] #35069 22 Mar 22 07:31 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
I wouldn't mind a reply either way but further testing seems to have revealed that i need to set xtr'xrow but clear xtr'targetrow. I thing targetrow was forcing xtree to display to relocate to the physical row number.

Re: XTREE: Focus Row [Re: Frank] #35070 22 Mar 22 07:49 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
That seems right. Virtually all of the row numbers specified to or from XTREE, such as xtr'xrow and xtr'targetrow, are physical row numbers. (As an aside, I have an outstanding request to somehow return the display row # associated with a physical row #, which would be useful in cases where you want to report some kind of information related to the XTREE in a Message Box, where the display row # would be a lot more meaningful to the user than the physical row #, but I'm not sure that would help you here.)

If you are on, say, physical row 10, and then you right click on row 15 causing an exit, xtr'xrow would be set to 10 and xtr'targetrow to 15. So if you you want to return to the original row, you should set xtr'targetrow to xtr'xrow.

Re: XTREE: Focus Row [Re: Frank] #35071 22 Mar 22 07:54 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Thanks for the reply.

Right, thanks... or just clear targetrow apparently wink I had it backwards where i was clearing xrow and setting targetrow.

Re: XTREE: Focus Row [Re: Frank] #35072 22 Mar 22 08:00 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Right - clearing targetrow should force it to use xrow instead on the re-entry.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3