Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Editing a CXTPReportItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Editing a CXTPReportItem

 Post Reply Post Reply
Author
Message
tjcosta View Drop Down
Newbie
Newbie
Avatar

Joined: 22 March 2007
Location: Portugal
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote tjcosta Quote  Post ReplyReply Direct Link To This Post Topic: Editing a CXTPReportItem
    Posted: 22 March 2007 at 1:23pm
Hi,

I have an Add button that creates a new Record for the CXTPReportControl, with three items, a Text Item, and two others, one with a dropdownbox and another with a checkbox.

Now I need to set the focus on the CXTPReportRecordItemText (the first one) so that the user may enter text as soon as a new line on the ReportControl is added...

Anyone care to lend a helping hand?

Thanks in advance,
Tiago Costa

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 5:16pm
Hi,

In our regular sample there is a sample "Task List" form where there is a menu item which adds a record and starts editing its item.

The code is as follows:

void CTaskListView::OnAddTask()
{
    CTaskRecord* pRecord = (CTaskRecord*)GetReportCtrl().AddRecord(new CTaskRecord(TRUE, taskImportanceNormal, FALSE, taskStatusNotStarted, _T(""), COleDateTime(), 0, _T("")));
    GetReportCtrl().Populate();

    CXTPReportRow* pRow = GetReportCtrl().GetRows()->Find(pRecord);
    if (pRow)
    {           
        XTP_REPORTRECORDITEM_ARGS itemArgs(&GetReportCtrl(), pRow, GetReportCtrl().GetColumns()->Find(COLUMN_SUBJECT));
        GetReportCtrl().EditItem(&itemArgs);
    }
}


--
WBR,
Serge
Back to Top
tjcosta View Drop Down
Newbie
Newbie
Avatar

Joined: 22 March 2007
Location: Portugal
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote tjcosta Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2007 at 4:50am
Thak you for the reply...

I needed a "quick fix" so I ended up emulating a mouse click over the item...
Very messy but still functional...

I have updated my code since I saw your post, works and its rather clean.. thanks again...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.

This page was generated in 0.141 seconds.