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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Container class in grid (Selects all the text when the control gets focus.) issue...

Status
Not open for further replies.

JaketonCuatro

Programmer
Oct 18, 2018
5
ES
Hi Let's see if someone can help me given that I'm getting a little crazy with the behavior of the container class with a text inside a grid.

Attached example project in which this behavior is seen.

Execute the incio form and in the I have 2 column3 with text class and column4 with the container class (with two text inside).

But if we go into grid press tab or return key, in the column3 the text is with the K format selected the complete cell but in the column4 class no work and cursor blinks at the beginning of text1 and it does not happen this.

Proyect example: Link

Thank you in advance for your answers.

 
i'm wary of linking to an unknown .zip file!

one likely problem when using containers in grids is to remember to set .sparse = .f. on the column.

hth

n



 
Is dropbox all files are scan and no have virus. See screen shot. attach .rar files rename to .ra_ if you prefer.

screenshot_20181018_162015_x2lmsq.jpg


 
 https://files.engineering.com/getfile.aspx?folder=4c61eb3a-19be-44ff-a6da-ea5bcb0a4ff9&file=prueba.ra_
I second Nigel, though I know it's not easy to share a grid with an alternative control just in code.

Let's tackle this from the other side.

I have used containers in grids, but I limited this to one container in a grid with a single column, so the grid columns concept then is fully replaced by a record container. So it's more like an Access subform if you know that concept.

How the textboxes inside the container act will not depend on how you set grid.column properties or grid.textX properties of the grid textbox, which would be used if your container wouldn't be the current control. Just setting the format within the container textboxes should work, let me try this.

I have built this situation from scratch and used a container with two textboxes I put into column3 of a grid, which has two normal column.
Indeed the first textbox in the container within the grid will not act according to Format="K" and select all text.

No idea why. I tried whether the Grid.Colum.Format would work, but it's also not respected. It also doesn't help to set SelStart and SelLength in GotFocus. and the SelectOnEntry property also won't do it. I also tried one extra textbox made visible=.f. or returning .F. from When(), in both cases the next textbox behaves without format K and/or SelecttOnEntry behavior.

Seems you have to live with that bug.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Thk Olaf i try too add a extra textbox with tabindex=1 and put this code in When (KEYBOARD '{TAB}' PLAIN CLEAR) this works but have one issue if user clic in second text the focus go to next object... i am still looking for...
 
1. You Return .F. from When to reject getting focus and focus then moves on to next tab index.
2. You don't do that in a textbox class so all textboxes do that, do you?
3. Well, for me this also DIDN'T work.

I don't think there is a fix for this.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top