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

Grid CurrentControl 1

Status
Not open for further replies.

FRANKYAL

Programmer
Nov 9, 2000
6
US
Hi,I want to add an Edit Box as the current control in a
grid column but I want to do it programmatically.

Thanks
 
Put in the columns init the following code:

LOCAL llRetVal

llRetVal = DODDEFAULT()

IF llRetVal
WITH THIS
.REMOVEOBJECT('Text1')
.ADDOBJECT('EditBox', 'EditBox')
.CURRENTCONTROL = 'EditBox'
ENDWITH
ENDIF

RETURN llRetVal

HTH,

Weedz (Wietze Veld)
veld4663@exact.nl
The Netherlands

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
weedz, following is corrected code:

WITH THIS.COLUMNS(1)
.Text1.Visible = .F. && Important!
.ADDOBJECT('EditBox', 'EditBox')
.EditBox.Visible = .T. && Important!
.REMOVEOBJECT('Text1') && do not leave column without objects
.CURRENTCONTROL = 'EditBox'
.Sparse=.F. && this is to diisplay editbox in all rows,
&& otherwise you will get 'memo' in the all
&& rows except current
ENDWITH




Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Vlad, you are right (as often is the case if not always ;-) ).

I forgot about the Visible property, have been struggling with this one in the past myself. ;-)

Cheers,

Weedz (Wietze Veld)
veld4663@exact.nl
The Netherlands

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Thank you for your answer. That was the solution for this
problem. Now the edit box is displaying the information
from a memo field but the edit box is not wrapping the information. I will display all the information in just one line and I need to scroll to the right to read all the info.

Thanks.
 
Frankyal, make enough size for grid row to let scroll bar apper in edit box, this should cause your edit box to wrap text correctly. This behavior is by design and I did not found a workaround for it except making my own container in the grid with edit box.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top