Print Page | Close Window

[SOLVED] SetFocusedRow broken in 15.01

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=17850
Printed Date: 29 September 2024 at 5:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] SetFocusedRow broken in 15.01
Posted By: flashk
Subject: [SOLVED] SetFocusedRow broken in 15.01
Date Posted: 09 February 2011 at 1:13pm
After updating to 15.01, CXTPReportControl::SetFocusedRow does not seem to work any more. The selected row does not change. This worked fine in the beta version.

Is there a different function I should use to programmatically select a specific row?




Replies:
Posted By: flashk
Date Posted: 09 February 2011 at 3:06pm
I was able to fix the issue by reverting the changes made to the SetFocusedRow function since the beta version. Basically, I modified the following section of the function from:
if (nFocusedRow != pRow->GetIndex() || pRow->GetType() != nFocusedRowType)
{
    CMDTARGET_ADDREF(pRow);

    BOOL bApply = OnFocusChanging(pRow, NULL);

    if (pRow->m_dwRef == 1) // Removed
        bApply = FALSE;

    CMDTARGET_RELEASE(pRow);

    if (!bApply)
        return FALSE;
}
to:
if (nFocusedRow != pRow->GetIndex() || pRow->GetType() != nFocusedRowType)
{
    if (!OnFocusChanging(pRow, NULL))
        return FALSE;
}



Posted By: flashk
Date Posted: 09 February 2011 at 3:30pm
I figured out why the newer version is broken. The CMDTARGET_RELEASE macro not only decrements the reference count, but also sets the pointer to 0.
#define CMDTARGET_RELEASE(x) if (x) { x->InternalRelease(); x = 0;}
I don't think this is the intended behavior. The line:
CMDTARGET_RELEASE(pRow);
should be changed to:
pRow->InternalRelease();
This fixed the issue for me.


Posted By: Oleg
Date Posted: 10 February 2011 at 2:53am
Thanks, fix is comming.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Alex G.
Date Posted: 25 February 2011 at 3:24am

Will there be a bug release ?



Posted By: SuperMario
Date Posted: 10 March 2011 at 12:48pm
already released



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