CXTPReportControl edit mode |
Post Reply |
Author | |
dmitklg
Newbie Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 24 March 2006 at 5:40am |
How can I edit the label of the new CXTPReportRecordItem? (using code, not by user action).
The new row must be visible, selected and the first cell must be in edit mode, so the user can change the text. my code don't work CXTPReportRow * pRow = m_wndReport.GetRows()->GetAt(m_wndReport.GetRows()->Ge tCount()- 1); m_wndReport.EnsureVisible(pRow); m_wndReport.GetSelectedRows()->Select(pRow); m_wndReport.SetFocusedRow(pRow); CRect rc; CXTPReportRow * pRow = m_wndReport.GetFocusedRow(); if (pRow) { CXTPReportRecordItemText * pName = (CXTPReportRecordItemText *)pRow->GetRecord()->GetItem(1); rc = pRow->GetItemRect(pName); pRow->OnDblClick(rc.TopLeft()); CXTPReportInplaceEdit* pEdit = pRow->GetControl()->GetInplaceEdit(); pEdit->SetSel(0,-1); } |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Instead of direct use of inplace edit control there you'd better call CXTPReportControl::EditItem() -- WBR, Serge |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
ps: just change your if() to following:
|
|
dmitklg
Newbie Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
i test this code but it don't work
InplaceEdit not visible m_wndReport.SetFocus(); CXTPReportRecord* pRecord = m_wndReport.AddRecord(new CXTPReportRecord()); pRecord->AddItem(new CXTPReportRecordItemNumber(0,">") ); pRecord->AddItem(new CXTPReportRecordItemText("new line")); m_wndReport.Populate(); CXTPReportRow * pRow = m_wndReport.GetRows()->Find(pRecord); if (pRow) { m_wndReport.SetFocusedRow(pRow); XTP_REPORTRECORDITEM_ARGS args(&m_wndReport, pRow, m_wndReport.GetColumns()->GetAt(1)); m_wndReport.EditItem(&args); } |
|
dmitklg
Newbie Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
void CXTPReportInplaceEdit::Create(XTP_REPORTRECORDITEM_ARGS* pItemArgs)
{ SetItemArgs(pItemArgs); m_pSelectedConstraint = NULL; XTP_REPORTRECORDITEM_METRICS metrics; metrics.strText = pItem->GetCaption(pColumn); pItemArgs->pRow->FillMetrics(pColumn, pItem, &metrics); CRect rect = pItemArgs->rcItem; <<<< rect = (39,0,235,0) whi is it? |
|
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 |