Changing edit options of record item |
Post Reply |
Author | |
coco
Newbie Joined: 30 June 2009 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 01 July 2009 at 2:43pm |
Hi,
I am facing a problem when trying to edit options of record items instead of columns.
The context is: I need to implement a report control with a column
of type combo box, but the constraints of the combo boxes will not be
the same for all records. For instance, even lines will have a set of
constraint and odd lines will have another set of constraints (it was a
simplified example).
Hence, I am accessing CXTPReportRecordItemEditOptions from each record instead of accessing it from the column.
PS: documentation says that this class represents edit options of the single item or column.
However, when I change edit options of a record, it is extended to the whole column.
Does anyone know how can I change edit options (setting contraints) of a specific record?
This is the code (adapted) in focus:
CXTPReportColumns* pCols = repControl.GetColumns();
CXTPReportRecords* pRecords = repControl.GetRecords(); CXTPReportRecordItemEditOptions* pEditOptions; CXTPReportColumn* pCol; // resetting constraints for dynamic combo box "COLUMN_ID", row by row pCol = pCols->GetAt( COLUMN_ID ); for ( int i = 0; i < pRecords->GetCount(); i++ ) { // clear old constraints pRecord = ( MyRecord* )pRecords->GetAt( i ); pEditOptions = ( pRecord->GetItem( COLUMN_ID ) )->GetEditOptions( pCol ); pEditOptions->GetConstraints()->RemoveAll(); // repopulate "id" constraints according to even/odd line if ( i % 2 == 0 ) { for ( int i = MIN_PROP_ID; i <= MAX_PROP_ID; i++ ) pEditOptions->AddConstraint( ToString( i ) ); } else { for ( int i = MIN_INV_ID; i <= MAX_INV_ID; i++ ) pEditOptions->AddConstraint( ToString( i ) ); } } |
|
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2 Language: Visual C++ MFC 2003 |
|
coco
Newbie Joined: 30 June 2009 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
I don't know if I was clear. It is a simple feature and I can not implement it in no way. I just must implement a column where different lines shall have different constraints. However, when I try to edit options of a specific record item by CXTPReportRecordItem::GetEditOptions method, it requires me a pColumn parameter: CXTPReportRecordItemEditOptions* GetEditOptions( CXTPReportColumn* pColumn ); It seems that the returned value is a pointer to the column edit options. How can I access the edit option of a specific record (not applied to the whole column)? |
|
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2 Language: Visual C++ MFC 2003 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
CXTPReportColumn| // Retrieves CXTPReportRecordItemEditOptions.
// Returns:
// Edit Options of column
//-----------------------------------------------------------------------
CXTPReportRecordItemEditOptions* GetEditOptions() const;
CXTPReportRecordItemEditOptions* m_pEditOptions; // Edit options of the columnCXTPReportRecordItem
CXTPReportRecordItemEditOptions* m_pEditOptions; // Edit options of the item.
CXTPReportRecordItemEditOptions* CXTPReportRecordItem::GetEditOptions(CXTPReportColumn* pColumn) { if (m_pEditOptions) return m_pEditOptions; if (pColumn) return pColumn->GetEditOptions(); return m_pEditOptions = new CXTPReportRecordItemEditOptions();} so you need to pass NULL instead of pColumn to create individual CXTPReportRecordItem::m_pEditOptions
|
|
coco
Newbie Joined: 30 June 2009 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Perfect, Doubson!
Thanks a lot. |
|
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2 Language: Visual C++ MFC 2003 |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
I'm trying to achieve something similar, but can't seem to get it to work properly.
I've got basically two lists of constraints to be chosen via a combo box. But it seems that if the first row's combo box has 10 items and the second row's combo has 11 items (and I can see them correctly - 10 and 11), I cannot select the last item in the second row's combo. I still need to investigate this a bit deeper... |
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
Lee Inwoo
Newbie Joined: 31 July 2010 Location: Korea, South Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Hi,
Could you show me the sample code more exactly plz?
The code you wrote not work (since I can't understand).
My environment info is as follows: Product: Xtreme Toolkit Pro version 13.4.0 Platform: Windows 7(64bit) Language: Visual C++ MFC 2008 |
|
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 |