Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Get Constraint assoziated Data from Combo
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Get Constraint assoziated Data from Combo

 Post Reply Post Reply
Author
Message
Janomat View Drop Down
Newbie
Newbie
Avatar

Joined: 20 February 2006
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Janomat Quote  Post ReplyReply Direct Link To This Post Topic: Get Constraint assoziated Data from Combo
    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





Back to Top
Janomat View Drop Down
Newbie
Newbie
Avatar

Joined: 20 February 2006
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Janomat Quote  Post ReplyReply Direct Link To This Post 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;
        }
    }
};


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.125 seconds.