Option() method is very nice but it is not possible to get access to the underlying control (for example to set a WhenAction()).
To get that possibility when adding a row I have to do this:
while(SQL.Fetch()) { // Loop for all fetched data
grid.Add(); // Added new row
for (int i = 0; i < fields.GetCount(); ++i) { // For all fields
sqlBase.grid(i) = SQL[i]; // Filling with data
if (column is Option) { // THIS HAVE TO BE DONE FOR ALL ROWS
Option *opt = new Option(); // new Option()
opt->WhenAction = THISBACK(MyCallback); // Set the callback to the control
sqlBase.grid.SetCtrl(i, opt); // Set the control to the cell
}
}
}
unodgs Messages: 1366 Registered: November 2005 Location: Poland
Ultimate Contributor
Yes, there is
There is WhenCtrlAction and WhenCtrlsAction. First is called for every embedded control if there was leftdown righdown or mousewheel action. Second is called for every kind of action for controls that where created automatically for column (by for example using Option() method). You can use it like this: