![]() |
Edit new item |
Post Reply
|
| Author | |
dmitklg
Newbie
Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Topic: Edit new itemPosted: 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 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 April 2006 at 5:50am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 April 2006 at 12:11am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 April 2006 at 1:25pm |
|
Do you have your GetItemMetrics() event handlers?
|
|
![]() |
|
dmitklg
Newbie
Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 April 2006 at 12:10am |
|
no
|
|
![]() |
|
dmitklg
Newbie
Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 April 2006 at 1:29am |
|
it need?
|
|
![]() |
|
sserge
Moderator Group
Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 April 2006 at 8:18am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 April 2006 at 12:24am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 April 2006 at 2:07pm |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 April 2006 at 1:02am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 April 2006 at 4:36am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 April 2006 at 10:08am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 April 2006 at 12:10am |
|
now i need delete row from Report if user Canceled edit
it possible? |
|
![]() |
|
dmitklg
Newbie
Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 April 2006 at 1:02am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 April 2006 at 10:55am |
|
For the last problem calling AdjustLayout() first could help.
-- WBR, Serge |
|
![]() |
|
dmitklg
Newbie
Joined: 24 March 2006 Status: Offline Points: 17 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 April 2006 at 12:09am |
|
now i need delete row from Report if user Canceled edit
it possible? |
|
![]() |
|
sserge
Moderator Group
Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 April 2006 at 8:22am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 April 2006 at 12:04am |
|
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 |