![]() |
Edit new item |
Post Reply ![]() |
Author | |
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() Posted: 30 March 2006 at 6:17am |
InplaceEdit not visible
why? m_wndReport.SetFocus(); CXTPReportRecord* pRecord = m_wndReport.AddRecord(new CXTPReportRecord()); pRecord->AddI tem(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);В ; } |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Hi,
1) m_wndReport.SetFocusedRow(pRow) is not necessary because .EditItem() makes the edited cell focused automatically. Please delete this line. 2) Before calling EditItem please ensure that all editing restrictions are enabled. For example, for your method it might be necessary to call in the beginning:
-- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
InplaceEdit is visible
but it CRect is bad please veiw code void CXTPReportInplaceEdit::Create(XTP_REPORTRECORDITEM_ARGS* pItemArgs){ SetItemArgs(pItemArgs);&n bsp; m_pSelectedConstraint = NULL; XTP_REPORTRECORDITEM_METRICS metrics; metrics.strText = pItem->GetCaption(pColumn); pItemA rgs->pRow->FillMetrics(pColumn, pItem, &metrics); CRect rect = pItemArgs->rcItem; <<<< rect = (39,0,235,0)whi is it? |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Do you have your GetItemMetrics() event handlers?
|
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
no
|
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
it need?
|
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Actually, no, but there a rect might be changed. Need to look at your methods in more details for further investigations. If you have a sample illustrating the problem, it would be useful to look at. You can also submit it as an issue into Customer area...
-- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
i need insert new row and edit it from code
my code void CMenuDialog::OnDbAdd() { CString str; ULONG id; str = m_sTXTAlias + " - вставка"; CInputDialog dlg; dlg.SetTitle(str); if (dlg.DoModal() == IDOK && !dlg.m_sInput.IsEmpty()) { str = dlg.m_sInput; TRY { theApp.m_MysqlConnection.ExecuteSQLV("insert into %s (id,%s) values (NULL,'%s')",m_sTableName, m_sTXTField,str); id = theApp.m_MysqlConnection.GetLastID(); m_wndReport.SetFocus(); CXTPReportRecord* pRecord = m_wndReport.AddRecord(new CXTPReportRecord()); pRecord->AddItem(new CXTPReportRecordItemNumber(id) ); pRecord->AddItem(new CXTPReportRecordItemText(str)); 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); } } CATCH(CSQLException, e) { e->ReportError(); } END_CATCH } } inplace edit created but not visible CRect for inplace edit invalid rect = (39,0,235,0) |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Delete this line: m_wndReport.SetFocusedRow(pRow); -- as I mentioned it is not necessary. See also sample method: void CTaskListView::OnAddTask() Let me know whether this helped. -- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
CXTPReportRecord* pRecord = m_wndReport.AddRecord(new CXTPReportRecord());
pRecord->AddItem(new CXTPReportRecordItemNumber(4444) ); pRecord->AddItem(new CXTPReportRecordItemText("new item")); m_wndReport.Populate(); CXTPReportRow* pRow = m_wndReport.GetRows()->Find(pRecord); if (pRow) { XTP_REPORTRECORDITEM_ARGS itemArgs(&m_wndReport, pRow, m_wndReport.GetColumns()->Find(1)); m_wndReport.EditItem(&itemArgs); } inplace edit created but not visible my version xtreme toolbar is 9.61 my be it is bug 9.61 ? |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
my solution
while ( ::PeekMessage( &iMsg, NULL, NULL, NULL, PM_NOREMOVE ) ) { ::AfxGetThread()->PumpMessage(); // pump messages until queue is // empty } |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Nice to hear that you've found the solution.
If you'll have the same problem with the latest version of the library, please raise this issue again. -- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
now i need delete row from Report if user Canceled edit
it possible? |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
while ( ::PeekMessage( &iMsg, NULL, NULL, NULL, PM_NOREMOVE ) )
{ ::AfxGetThread()->PumpMessage(); // pump messages until queue is // empty } it don't work if scrollbar is visible :((( InplaceEdit show in invalid place :(( |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
For the last problem calling AdjustLayout() first could help.
-- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
now i need delete row from Report if user Canceled edit
it possible? |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
After editing you'll have to check whether any item of a newly added record differs from the initial value. If there are no any changes, then just delete a record.
-- WBR, Serge |
|
![]() |
|
dmitklg ![]() Newbie ![]() Joined: 24 March 2006 Status: Offline Points: 17 |
![]() ![]() ![]() ![]() ![]() |
please write sample code
|
|
![]() |
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 |