At 12:42 2013-09-17, "Tracy Pearson" <[email protected]> wrote:
Gene Wirchenko wrote on 2013-09-17:
> Dear Vixens and Reynards:
> Relating to my problem with getting some grid code going, does
> anyone have any sample grid code where the grid is subclassed?
Like this below?
Not quite.
I want something more dynamic. Specifically, I would like to
be able to createobject() the grid so that I can pass
parameters. When I use createobject() instead, I get the problem
with nothing displaying.
Is it possible to use createobject() with grids?
LOCAL loForm
loForm = CREATEOBJECT("testform")
loForm.Show(1)
RELEASE loForm
CLEAR CLASS "testform"
DEFINE CLASS testform as Form
width = 400
height = 400
datasession = 2
ADD OBJECT grd as grd
I tried replacing the above line with:
theGrid=.f.
procedure init
this.theGrid=createobject("grd")
return .t.
endproc
and get no grid displayed.
PROCEDURE load
CREATE CURSOR testdata ( ;
ikey i, ;
cone c(10), ;
itwo i)
INDEX ON ikey TAG ikey
INDEX on itwo TAG itwo
INSERT INTO testdata ;
VALUES (1, "one", 1)
INSERT INTO testdata ;
VALUES (2, "three", 3)
INSERT INTO testdata ;
VALUES (3, "two", 2)
ENDPROC
ENDDEFINE
DEFINE CLASS grd as grid
top = 10
left = 10
width = 380
height = 380
columncount = 2
rowsource = "testdata"
rowsourcetype = 1
anchor = 15
AllowCellSelection = .F.
recordmark = .f.
deletemark = .f.
splitbar = .f.
PROCEDURE init
this.column1.controlsource = "testdata.cone"
this.column1.header1.caption = "One"
this.column2.controlsource = "testdata.itwo"
this.column2.header1.caption = "Two"
ENDPROC
PROCEDURE DblClick
ThisForm.Release()
ENDPROC
ENDDEFINE
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.