About ReportControl cannot edit; |
Post Reply |
Author | |
lyl0625
Newbie Joined: 27 July 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 28 July 2009 at 3:32am |
have a report control in a CXTPReportView,
pCol->SetEditable(TRUE); m_Report.AllowEdit(TRUE); m_Report.Populate(); But, when I click on a cell, it looks like it starts to edit, but when I press a key I always get an exception here:
void CXTPReportInplaceEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{ CXTPReportControl* _pControl = pControl; ASSERT(_pControl); Because pControl is NULL
I don't know what's going on?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I guess it means there is no ReportRecordItem behind. How you create your records and items?
|
|
lyl0625
Newbie Joined: 27 July 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Thanks for you anttention!
I create the ReportRecordItem behind ,but I just cannot edit it.
this is my code,for example:
CXTPReportControl& wndReportCtrl = GetReportCtrl();
CXTPReportRecord *m_Record = new CMobileInfoReportRecord(1, "1","1","1");
wndReportCtrl.AddRecord(m_Record); m_Record=new CMobileInfoReportRecord(2,"liaoyanli","040411008","mail");
wndReportCtrl.AddRecord(m_Record); |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You don't need to set pCol->SetEditable(TRUE); (this is default) but you need to call wndReport.FocusSubItems(TRUE); (default is FALSE) Also check Sample Files: "MessageRecord.h" and "MessageRecord.cpp" You will find how it set to use different types of ReportRecordItemYou can use CXTPReportRecordItem but only for display. If you need editable cell - use derived classes: CXTPReportRecordItemText and similar. (Consider this as analog to CStatic, CEdit and so on) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Get fresh upgrade please https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
Little change for in-place combo case [double click and EditOnClick = FALSE combination]
|
|
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 |