Print Page | Close Window

How to insert a combobox?

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=6730
Printed Date: 22 November 2024 at 8:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to insert a combobox?
Posted By: neverdie10
Subject: How to insert a combobox?
Date Posted: 26 March 2007 at 12:06am
Hello.

I want to insert a combobox in column.
How to insert?

class CRRListView : public CXTPReportView
{
public:
void InitListCtrl();
};

void CRRListView::InitListCtrl()
{
...
// Add sample records
m_wndReport.AddRecord(new CMessageRecord(
    _T("Item1"),
    _T("Item2"),
    _T("Item3"),
    _T("Item4"),
    1,
    _T("Item5"),
    _T("Item6"),
    _T("Item7"),
    _T("Item8") //--> Want to insert a combobox
    ) );
}

Thanks.



Replies:
Posted By: neverdie10
Date Posted: 26 March 2007 at 9:29pm
class CRRListView : public CXTPReportView
{
proteced:
CComboBoxExt*          m_pListCombo;
};

void CRRListView::OnReportItemClick(NMHDR* pNotifyStruct, LRESULT* /*result*/)
{
XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*)pNotifyStruct;
if( !pItemNotify->pItem )
return;
//ASSERT(pItemNotify->pColumn);
     
if( pItemNotify->pItem->GetIndex() == 8 )
{
// Is already combo box is there?
if( m_pListCombo )
{
    // Kill the focus of combo box
    SetFocus();
    // Delete combo box
    delete m_pListCombo;
    m_pListCombo = NULL;
}

CRect crRect = pItemNotify->pRow->GetItemRect( pItemNotify->pItem );
m_pListCombo = new CComboBoxExt;
crRect.bottom += 100;
m_pListCombo->Create(WS_CHILD |
WS_VISIBLE |WS_TABSTOP | CBS_DROPDOWNLIST |          
WS_VSCROLL |WS_HSCROLL,crRect,&GetReportCtrl(),ID_COMBO);

m_pListCombo->SetFocus();
}
}



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