Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus() in grid column
Message
From
29/06/2001 02:26:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00525000
Message ID:
00525049
Views:
18
>That can happen if you moved the columns in your grid around. Check what is the name of the column which really gets focus. See the sample form I just sent you where everything works as you want it, and check what is different from yours.
>
>Also, you might want to use WITH ... ENDWITH to simplify and speed up your code:
>
>WITH thisform.grid1
>.Column3.readonly=.f.
>.Column4.readonly=.f.
>.Column5.readonly=.f.
>.Column6.readonly=.f.
>.Column7.readonly=.f.
>.Column8.readonly=.f.
>sele MyTempGridFile
>appe blank
>.refresh()
>.column3.setfocus()
>ENDWITH
>
>
>Or use SetAll method:
>
>WITH thisform.grid1
>.SetAll("ReadOnly", .f., "Column") && Column 1 and 2 have .Enabled = .f. so their .ReadOnly setting does not really matter
>sele MyTempGridFile
>appe blank
>.refresh()
>.column3.setfocus()
>ENDWITH

Yes, you were right there is something wrong with my code, I've check that the problem because I freeze the column.

here is the code in the thisform.grid1.scrolled :

this.column3.columnorder = 3
this.column4.columnorder = 4
this.column5.columnorder = 5
this.column6.columnorder = 6
this.column7.columnorder = 7
this.column8.columnorder = 8
this.column1.columnorder = this.leftcolumn
this.column2.columnorder = this.leftcolumn+1

If I don't freeze it there is nothing wrong, or maybe I should add some code, do you have any idea ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform