>with this > .columncount=2 > .recordsource="crsr1" > .column1.controlsource="crsr1.id" > .column1.header1.caption='ID' > > .column2.controlsource="crsr1.prudact" > .column2.header1.caption='Prudact' > .setall("width",111,"column") > .setall("alignment",2,"column") > .setall("alignment",2,"header") > .refresh >endwith>My quastion is how can I add (via nint) another column with command button and to manipulate the commandbutton.click code.
.addobject("colWithButton","column") with getpem(this, "colWithButton") .addobject("cmdButt", "myCmdButt") .currentcontrol="cmdbutt" .removeobject("text1") .sparse=.f. * any other properties you may want to set - header caption, alignment etc) *-- and bindevent, if you want to go that way bindevent(this.colwithbutton.cmdButt, "click", thisform, "DoGridButtonClick") endwithAs for the bindevent() versus code in the button - since you are adding the button on the fly, you can't have the code in the instance, it must be elsewhere. To me, it's more OOP to do that in the class, i.e. have a special button class for this occasion, which will hold everything that pertains to that button. If it's just a generic button and the code it runs is specific to this form anyway - i.e. if the code would be the standard "thisform.doSomething()" line, then bindevent() looks cleaner.