>Hello,
>
>I have a grid on my form, initially it's columncount is set to -1. Programatically I set the columncount to 5 (for example) and specify the properties for each column etc.
>However, always the baseclass TextBox is used to populate the columns, is there a way to populate the columns with another textbox class, because I need to have some methods in them.
>
>Thanks for help.
Hi,
This can be done both graphically, or from code.
In code, for each column
loColumn.RemoveObject("text1")
loColumn.AddObject("txtNewTextbox", "txtClassName")
loColumn.CurrentControl = "txtNewTextbox"
* You might want sparse = .f. also
loColumn.Sparse = .f.
Graphically (a bit long winded and it's probably in a FAQ somewhere).
1) Select the text1 control from the appropriate grid column in the object list of the properties window.
2) Click with the mouse oonce on the title bar of your new form (in the design window)
3) Press the delete key - This will delete the text1 object from the grid column
4) Set the Form Controls toolbar up so that it's showing the visual classes from the class library containing the new textbox class
5) select the grid column object from the object list of the properties window
6) Click once on your new Textbox class in the toolbar, then click once in the column of the grid.
This will add a new textbox, created from your class definition.