Hi João,
I may suggest you something, but this is not easy. After you assign RecordSource to your grid, e.g.
thisform.Init
lparameter lcTableName
with thisform.grid1
.RecordSource=lcTableName
local loColumn
for each loColumn in .Columns
loColumn.RemoveObject('text1')
loColumn.NewObject('text1','mytext', 'myclasslib.vcx')
loColumn.text1.visible=.t.
next
endwith
You should create your own textbox class for this specific purpose. (I referenced it as myText in myClassLib)
In myText.Click event you should have
if type('this.parent')='column' && used in a grid
this.parent.parent.click() && use Grid Click Method
endif
The similar code could be in KeyPress event.
I haven't tested this code (wrote directly from my mind), so there could be some problems, but you should get the idea.
HTH
>Hi, all
>
>I have first form (myForm1) that have a search button that open's another form with a grid, this grid receive the alias from myForm1, so i don't have properties and code to the columns, but when i click in the first columm or second columm i need to do something with code, in this case the code is the same if i click in the first or in the second, what's the way to do that.
>
>Thnak's in Advance
>
>João Batista
>(Beginner VFP6)
If it's not broken, fix it until it is.
My Blog