Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Problems with Populate() now auto-selecting a row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems with Populate() now auto-selecting a row

 Post Reply Post Reply
Author
Message
drisch View Drop Down
Groupie
Groupie


Joined: 06 July 2006
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote drisch Quote  Post ReplyReply Direct Link To This Post Topic: Problems with Populate() now auto-selecting a row
    Posted: 13 April 2012 at 10:45am

We use report controls extensively in our applications (probably more than 20 in each) and we recently upgraded from XTP 15.2.1 to 15.2.1.0403 to address a crash when dragging a grouped field onto the report. However we almost immediately began noticing very strange behavior all over our application. It turns out that each time we load data into the report control, an item is now auto-selected. Since we often respond to a user selection of data, we had the application going crazy and selecting things by itself all over the place in response to Populate calls as we often show subdetails from one item in a second report, and their children in a third. We don't want a cascading effect if the user is not actually physically clicking on the row.

Here is the new piece of code inserted after the initial release of 15.2.1 at the end of CXTPReportControl::Populate(). 

if (GetBehavior()->Notifications->Populate->bSelectionChanged)
{
   if (m_pSelectedRows->IsChanged())
   {
      OnSelectionChanged();
      m_pSelectedRows->SetChanged(FALSE);
   }
}

We are not sure why this new piece of code is here. There doesn't seem to be any mention of this in the release notes. Is this a new feature?. Why is the default behavior now to send a selection changed message on populate? The CXTPReportBehavior class is not even documented. I suppose we can go to each of our report controls and set the bSelectionChanged variable to false, but would it not make more sense that this should be false by default if this makes such a big change in behavior?

For now we are thinking of rolling back to the initial 15.2.1 release and live with the bugs that the hotfix resolves rather than trying to patch this new behavior and possibly miss some cases.

Derek

Back to Top
fjosesen View Drop Down
Groupie
Groupie
Avatar

Joined: 30 June 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote fjosesen Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2012 at 9:47am
    Hi,
 
    I'm also experiencing problems when dropping an element. Now, the first row in the control is selected, scrolling up to it. So, it's very annoying to play with drag and drop. I'm not sure if it is the same problem that described in this post. I'm also using the ActiveX version of the control.
 
    Can anyone tell us anything about how to activate/simulate the previous behaviour?
 
    Kind regards,
 
Sen
 
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)
Back to Top
drisch View Drop Down
Groupie
Groupie


Joined: 06 July 2006
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote drisch Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2012 at 1:21pm

We seem to have found a solution which we are testing. We call the following on the CXTPReportControl item and this seems to prevent auto-selection.

   InitialSelectionEnable(FALSE);

-Derek
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2012 at 3:38pm
Originally posted by drisch drisch wrote:

We are not sure why this new piece of code is here. There doesn't seem to be any mention of this in the release notes. Is this a new feature?

Hello,

this is a bugfix. The report control has always selected the first row on populate if InitialSelectionEnable was enabled, but hasn't send the notification that the selection has changed.

If you do not want this message to be send, you can set GetBehavior()->Notifications->Populate->bSelectionChanged to FALSE.

Andre

Codejock support
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.