Print Page | Close Window

Get Constraint assoziated Data from Combo

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=3676
Printed Date: 23 November 2024 at 9:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get Constraint assoziated Data from Combo
Posted By: Janomat
Subject: Get Constraint assoziated Data from Combo
Date Posted: 20 February 2006 at 5:25am
Hi there,

i´m facing problems in retrieving the assoziated constraint data from an inplace combo on a CXTPReportControl. While adding the data is no problem i find that retrieving is absolutly impossible. Here is the code snipped:

    CXTPReportRecordItemEditOptions *m_pEditOptions;
    m_pEditOptions = pColumn->GetEditOptions();
    m_pEditOptions->m_bAllowEdit = false;
    m_pEditOptions->m_bConstraintEdit = false;
    m_pEditOptions->AddComboButton();
    m_pEditOptions->AddConstraint(_T("Name"),1);
    m_pEditOptions->AddConstraint(_T("Surname"),2);

I receive the notification for the changed value using
    ON_NOTIFY(XTP_NM_REPORT_VALUECHANGED, IDC_LISTPARAM, EditItemPARAM)

While the recorditem is holding the new string value after edit the item is NOT holding the associated data value

CXTPReportRecordItemText *pItem = dynamic_cast<CXTPReportRecordItemText*>(pItemNotify-&a mp;g t;pItem);

pItem->GetValue() success (holds the selected text value)
pItem->GetItemData() fails (always 0)

Questions:
1.) Why does the inplace combo set the text value but not the data value ?
2.) How do i retrieve the selected index or the selected constraint itself if NOT using enum types (cannot handle this here cause the content of the inplacebutton changes with every edit)

Would be really happy if someone can answer these questions...

Jan








Replies:
Posted By: Janomat
Date Posted: 20 February 2006 at 6:25am
Fixed the problem by adding an own implementation of CXTPReportRecordItem:

Here is the code snipped:

class MyCustomReportRecordItem : public CXTPReportRecordItem
{
    virtual void OnConstraintChanged(XTP_REPORTRECORDITEM_ARGS* pItemArgs, CXTPReportRecordItemConstraint* pConstraint)
    {
        if(pConstraint)
        {
            m_dwData = pConstraint->m_dwData;
            m_strCaption = pConstraint->m_strConstraint;
        }
    }
};





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