Get Constraint assoziated Data from Combo |
Post Reply |
Author | |
Janomat
Newbie Joined: 20 February 2006 Status: Offline Points: 5 |
Post Options
Thanks(0)
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 |
|
Janomat
Newbie Joined: 20 February 2006 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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; } } }; |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |