|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » [Solved albeit ugly] Scrolling messes up GridCtrl in certain condition
[Solved albeit ugly] Scrolling messes up GridCtrl in certain condition [message #39211] |
Thu, 28 February 2013 13:06  |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
See attached sample code.
Run the example, click "refresh" button to populate the GridCtrl. Drag the vertical scollbar and move down, the GridCtrl will be messed up.
Also, the sum row reports incorrect total. The last row in the GridCtrl is not counted. Click any column header to sort the GridCtrl, the correct sum will appear. Call UpdateSummary() manually after changing data will fix it. Not sure if this is required by design.
SaleInvoiceListTab::SaleInvoiceListTab()
{
CtrlLayout(*this);
refresh<<=THISBACK(RefreshReport);
//RefreshReport();
// Note: uncomment above line will eliminate the Paint issue
}
Thanks,
Lance
[Updated on: Sat, 02 March 2013 00:48] Report message to a moderator
|
|
|
Re: [GridCtrl] Scrolling messes up GridCtrl in certian condition [message #39226 is a reply to message #39211] |
Sat, 02 March 2013 00:42   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
A temporary fix for the above problem(In my case, open with populated grid is not practical):
remove the GridCtrl from its parent and add back after repopulation.
And also pay special attention to the aggregate functions of GridCtrl. Do a UpdateSummary() after repopulation since the very last row might be skipped.
Disclaimer: it might be because I don't know the proper (designed) way of using the Ctrl. E.g., months back I learned that programmatically changing column widths should be sandwiched in Ready(false) and Ready(true). Note in this case, I tried to do the same (sandwich data changes in Ready(...) calls) but to no avail.
----------------
PS: Remove & Add back will fix the incorrect summary issue.
I also tried Hide() - change - Show(), this way the problem remains. It seems some action taken when a GridCtrl is initially activated has not been synchronized properly by subsequent changes to the GridCtrl structure/data.
[Updated on: Sat, 02 March 2013 01:02] Report message to a moderator
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 11:18:49 CEST 2025
Total time taken to generate the page: 0.03962 seconds
|
|
|