Print Page | Close Window

Problems with Populate() now auto-selecting a row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=19652
Printed Date: 28 September 2024 at 7:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems with Populate() now auto-selecting a row
Posted By: drisch
Subject: Problems with Populate() now auto-selecting a row
Date 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




Replies:
Posted By: fjosesen
Date 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)


Posted By: drisch
Date 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


Posted By: ABuenger
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net