![]() |
HOWTO: Setting focus after reload from DB? |
Post Reply ![]() |
Author | |
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() Posted: 18 December 2012 at 5:09pm |
Hi;
I'm populating the report control with data from a database table. These records are grouped by a single field. Now I'm trying to implement a smart database reload function that restores the state of all rows in the control. This means the group expand state and the selected rows including the single focused row - as far as they still exist after executing the reload. Due to the fact that CXTPReportControl::ResetContent() deletes all record and row collections, I'm unable to use these pointer after the reload. That's absolutely clear! Selecting normal rows is no problem, but since group rows do not have any information inside (calling row->GetRecord() is NULL) I have no idea how to find the same group row AFTER the reload. So my question is: How can I mark a group row by a tag that i can use as a key to find the same group row in the reloaded control? Did I miss a callback when group rows are created or are there any functions around that help me in solving this issue? TIA |
|
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: 1201 |
![]() ![]() ![]() ![]() ![]() |
Has really no one ever had the same to solve????
|
|
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: 1201 |
![]() ![]() ![]() ![]() ![]() |
Still no solution for this?
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
cluster ![]() Groupie ![]() Joined: 22 January 2015 Status: Offline Points: 91 |
![]() ![]() ![]() ![]() ![]() |
Hi Martin,
I am not sure if I understand you right, but maybe you have a look at the Report Sample:
|
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
Hi;
thanks for your reply, but it is definitely NOT what I am looking or. I want to expand group rows and modify their caption after refetching from database, but only those that were marked as to change before the reload happens. Problem is that group rows have no records attached to them to put some kind of additional identity into. But nevertheless, thanks! M. |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Two admittedly ugly ideas I can think of:
1) Every group row must have at least 1 child row, correct? If so, you could store information about the GroupRow in the first child row. 2) Every group row has a unique caption - you can use that as a key for a separate data structure that holds the GroupRow information that links back to your database. Hey, I didn't say they were pretty ;) |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
cluster ![]() Groupie ![]() Joined: 22 January 2015 Status: Offline Points: 91 |
![]() ![]() ![]() ![]() ![]() |
Hi Martin,
you could store the state of the CXTPReportGroupRow in a map
before you delete ( ResetContent() ) them. After populating and grouping you scan again the Rows and if you match a GroupRow ( IsGroupRow() ) you look in your map for the right caption name and reset the state. |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
Hi;
To 1) This is true, but the first child row may change between reload calls. To 2) The Caption is generated by data out of the database. This content may change too! Therefore both suggestions need more investigations by myself. Anyway, thanks! M. |
|
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 |