I'm using the grid in virtual mode but also want to update the text in a cell as I type in an editbox - a bit like in Excel where you type in the formula bar and the active cell updates in sync. Since I'm virtual I can't use Cells - is there another way I can do this?
The OnGetCellData event is where you enter the text that needs to be preset in the cell.
You can use BeginUpdate/EndUpdate combination to update the grid.
Pieter Scheldeman2015-01-07 04:46:17
Yes I'm using OnGetCellData with my underlying data, but need to have a way to enter text in the cell from code without affecting the underlying data. The cell should update as the user types each character in an external editbox, and when the user hits return the text will only then be copied to the underlying data structure.
I'll investigate placing a label or similar over the cell when in this mode.
Yes, the approach of an additional label can be used, there is currently no temporary cell/text field that can be used to accomplish this. Alternatively you could set a boolean flag on which column/row you are editing and then check that in the OnGetCellData and return the string of the edit component. When done editing, clear the flag and update the grid.
Pieter Scheldeman2015-01-07 09:37:23