|  | 
| [HOWTO] Edit in header rows in virtual mode | 
| Post Reply   | 
| Author | ||
| mgampi   Senior Member     Joined: 14 July 2003 Status: Offline Points: 1210 |  Post Options  Thanks(0)  Quote  Reply  Topic: [HOWTO] Edit in header rows in virtual mode Posted: 07 November 2017 at 4:23am | |
| 
   Hi; I try to edit header row items when I use a virtual report control in Toolkit 18.0.1. As a starting point I use the CJ "Virtual List Sample". I modified the code by adding those lines to the CVirtualListView::OnCreate function: 
 In body section the edit control appears, but not in the header section. What's wrong? TIA | ||
| 
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 | ||
|  | ||
| olebed   Senior Member   Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |  Post Options  Thanks(0)  Quote  Reply  Posted: 07 November 2017 at 2:45pm | |
| 
   Hello Martin, I have found what is the reason. Problem was in method CXTPReportControl::EditItem(). It resets pItemArgs->pRow but gets row always from body section. So fixed code is below: 
 Also you should use separated CVirtualRecord for header or footer sections because callback method for updating CVirtualRecord::UpdateRecordField() don't recognize sections. It used only row and column positions to identify records. Also for separates data sets. However maybe this will useful for you as is. Regards,  Oleksandr Lebed | ||
|  | ||
| mgampi   Senior Member     Joined: 14 July 2003 Status: Offline Points: 1210 |  Post Options  Thanks(0)  Quote  Reply  Posted: 08 November 2017 at 3:34am | |
| 
   Hi; I'll try it and come back soon. | ||
| 
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 | ||
|  | ||
| mgampi   Senior Member     Joined: 14 July 2003 Status: Offline Points: 1210 |  Post Options  Thanks(0)  Quote  Reply  Posted: 10 November 2017 at 3:22am | |
| 
   It works   , thanks... When will this be officially released? | ||
| 
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 | ||
|  | ||
| mgampi   Senior Member     Joined: 14 July 2003 Status: Offline Points: 1210 |  Post Options  Thanks(0)  Quote  Reply  Posted: 10 November 2017 at 6:17am | |
| 
   Hi; Now I have another problem: I have no records in the body section. I'm editing an item in the (only single) header row. That's ok, but when I click into the header item a second time, the text disappears. Moving the focus out of the item without typing, I see the initially entered text again. If the control has records in the body section, the item and edit control behave as expected. Strange! You can reproduce it with the above mentioned sample. | ||
| 
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 | ||
|  | ||
| olebed   Senior Member   Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |  Post Options  Thanks(0)  Quote  Reply  Posted: 10 November 2017 at 8:49am | |
| 
   Hi, 
 We are testing next release now but without recent changes. 
 On updating ReportControl the text are taken from DB, so I can suppose that you just don't save changes in DB. See methods CVirtualRecord::UpdateRecordField and CVirtualRecord::GetItemMetrics in sample VirtualList\VirtualListView.cpp My changes in Header section available also after restarting sample. Regards, Oleksandr Lebed | ||
|  | ||
| mgampi   Senior Member     Joined: 14 July 2003 Status: Offline Points: 1210 |  Post Options  Thanks(0)  Quote  Reply  Posted: 13 November 2017 at 7:39am | |
| 
   Strange, but after a full recompile of the Toolkit it works. TIA | ||
| 
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 | ||
|  | ||
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |