Hello,
I've got a BIG problem with my grid. When refreshing the grid, all my functionality I've build within the grid disappears!
What I do to refresh:
I select some records from a table into a cursor (select * from customers where id > 100 into cursor myCustomer).
This.recordsource = 'myCustomer'
Then I make a colored row:
.SetAll("DynamicBackColor","IIF(RECNO(myCustomer)==THIS.nRecordNr, RGB(0,0,128), RGB(255,255,255))", "Column"
.SetAll("DynamicForeColor","IIF(RECNO(myCustomer)==THIS.nRecordNr, RGB(255,255,255), RGB(0,0,0))", "Column"
.Refresh()
Problem:
When the data in the cursor is refreshed, vfp automatically unbinds the cursor to the recordsource of the grid, and then boun it to the recordsource of the grid again. When it unBounds the data, all objects are destroyed, like the columns, textboxes and the headers in the grid. When it bounds the data again, it creates new columns, textboxes and headers. But the problem is that I've got some code in the onClick events from the textboxes in the grid. And because there are new textboxes created all code is gone, and I don't know how to recreate the code in the textboxes onClick events on runtime?
Please help me, I've got no idea how to fix it,
When you could tell the grid that it should create textboxes from myTextboxClass then I could put the code there and everything was alright, but so far as I can see that's not possible.
Thanks for your time,
Charl
I've got a BIG problem with my grid. When refreshing the grid, all my functionality I've build within the grid disappears!
What I do to refresh:
I select some records from a table into a cursor (select * from customers where id > 100 into cursor myCustomer).
This.recordsource = 'myCustomer'
Then I make a colored row:
.SetAll("DynamicBackColor","IIF(RECNO(myCustomer)==THIS.nRecordNr, RGB(0,0,128), RGB(255,255,255))", "Column"
.SetAll("DynamicForeColor","IIF(RECNO(myCustomer)==THIS.nRecordNr, RGB(255,255,255), RGB(0,0,0))", "Column"
.Refresh()
Problem:
When the data in the cursor is refreshed, vfp automatically unbinds the cursor to the recordsource of the grid, and then boun it to the recordsource of the grid again. When it unBounds the data, all objects are destroyed, like the columns, textboxes and the headers in the grid. When it bounds the data again, it creates new columns, textboxes and headers. But the problem is that I've got some code in the onClick events from the textboxes in the grid. And because there are new textboxes created all code is gone, and I don't know how to recreate the code in the textboxes onClick events on runtime?
Please help me, I've got no idea how to fix it,
When you could tell the grid that it should create textboxes from myTextboxClass then I could put the code there and everything was alright, but so far as I can see that's not possible.
Thanks for your time,
Charl