In the form I only have one column defined because that is always there, see
below. Then I programmatically define the rest. However, I only do
"form.grMain.columns[cColumn] = new GRIDCOLUMN(form.grMain)" once because I
had problems when I did a release and redefined the col.
I will spend more time on it later.
Graham
this.GRMAIN = new ASIGRID(this)
with (this.GRMAIN)
onLeftMouseDown = class::Drag_onLeftMouseDown
onLeftDblClick = class::PROGRAMMING
dataLink = form.dmplus.qplus.rowset
columns["COLUMN1"] = new GRIDCOLUMN(form.GRMAIN)
columns["COLUMN1"].dataLink =
form.dmplus.qplus.rowset.fields["record_no"]
columns["COLUMN1"].editorType = 1 // EntryField
columns["COLUMN1"].width = 7.0
with (columns["COLUMN1"].editorControl)
picture = "99999"
fontName = ""
endwith
with (columns["COLUMN1"].headingControl)
function = "J"
fontName = ""
value = "Rec #"
endwith
allowAddRows = false
height = 17.90
left = 1.7143
top = 0.65
width = 95.0
endwith
Post by Greg HillI have code that is exactly as you describe.
I went into the debugger and found that I even though I though I was
changing the editorType to something new, infact I was "not". It just
running the code because the statement was returning true. Another words it
was comparing the values not changing them.
Are you sure you changing them?
Greg Hill
----- Original Message -----
Newsgroups: dbase.programming
Sent: Thursday, September 25, 2008 2:35 PM
Subject: Re: changing grid.editorType on the fly
Post by Graham MonkHi Greg,
I build grid columns programmatically in one case and set the editorType,
form.grMain.columns[cColumn].editorType :=
rsConfig.fields['editorType'].value
However, I am setting other properties after this such as width,
colorNormal, function, picture, ... I also set the dataLink before the
editorType.
Hope this helps, if not let me know and I will try a turnkey or you can post
one for me to try.
Regards,
Graham
Post by Greg HillIt appears that the columns editorType property is readonly? I have made
attempts to change to no avail.
I would hope that I am over looking something?
If it is infact readOnly it defeats the purpose of allowing the Grid to be
altered, because some editorTypes will not match up after manipulating the
Grid.
See dBASE Online help for "getColumnOrder( ) EXAMPLE"
I am currently getting around it by forcing all editorTypes to be type 1,
this way the initial re-creation of the grid properties doesn't throw an
error.
Anyone have any input on this?
Thank you in advance,
Greg Hill