>Hi All:
>
>I have 3 columns in a grid. The first column will display text up to 100 characters, while the second and third display the date.
>
>Problem: I would like to be able to get Grid1.Column1.Text1 to wrap text, so that all the hundred characters of text are visible. Further if the height of Column1.text1 increases, Column2.text1 and Column3.text1 should also reflect the exact increase.
>
>Any suggestions on how to accomplish this? Thank you all in advance.
Henry,
Add an editbox control to column. You could do that in code or designer. I find code easier (assuming you already set column's width) :
with this.columns(1)
.Addobject('edtMyText','Editbox')
.edtMyText.BorderStyle = 0
.edtMyText.visible = .t.
.Currentcontrol = 'edtMyText'
.Sparse = .F.
endwith
this.RowHeight = this.RowHeight * 2
In designer :
-Right click grid and select edit (VFP7 Ctrl+click also works)
-From form control toolbar select editbox and click on column 1
-Now an editbox with default name of "Edit1" is added to column and shows in PEM sheet
-Go to PEM sheet and set its BorderStyle to 0 && None
-In PEM sheet drop down object combo and select column1
-Set CurrentControl to "Edit1"
-Set Sparse to .F.
-Select grid and set rowheight higher such as current value * 2
Yet another method combines code with design time :)
-Click on your grid && so it's the only selected object at design time
-Go to command window and type
modi comm xx < CR >
to get a code window.
-In code window write
aselobj(arrGrd)
with arrGrd[1].columns(1)
.Addobject('edtMyText','Editbox')
.edtMyText.BorderStyle = 0
.Currentcontrol = 'edtMyText'
.Sparse = .F.
endwith
arrGrd[1].RowHeight = arrGrd[1].RowHeight * 2
select the code, right click and 'Execute selection'
-Close code window w/o saving
Cetin