>Hi
>I know how to add command button manually to grid.
>But I prefer to build my grid in grid.init, something like this:
>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.
>Thanks
You can add another column by changing the Grid.ColumnCount property.
To add a button, I guess you would use either .AddObject() or .NewObject().
To include code in such an included object, you can either:
Add an object based on a class - the class will already have the required commands.
Use BindEvent() to attack existing code to an event. I think this one was introduced in VFP 9.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)