Print Page | Close Window

Editing a CXTPReportItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6708
Printed Date: 12 November 2025 at 11:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Editing a CXTPReportItem
Posted By: tjcosta
Subject: Editing a CXTPReportItem
Date 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




Replies:
Posted By: sserge
Date 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


Posted By: tjcosta
Date 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...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net