![]() |
ReportControl item with checkbox |
Post Reply
|
| Author | |
Arnie
Newbie
Joined: 04 March 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: ReportControl item with checkboxPosted: 04 March 2005 at 8:40am |
|
Hi, Here is part of a class that i would like to use for records in a report control that displays items with checkboxes: class CRecordPropertyCheck : public CXTPReportRecord
|
|
![]() |
|
sserge
Moderator Group
Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 March 2005 at 10:08am |
|
Hi Arnie,
Instead of using SetCaption you should override GetCaption method inside your class, for example: virtual CString GetCaption() { return IsChecked() ? "Yes":"No"; } And inside OnClick method you should only change your internal class state and call control redraw to update the view: virtual void OnClick(XTP_REPORTRECORDITEM_CLICKARGS* pClickArgs) { if (...) // any your conditions { SetChecked(!IsChecked()); pClickArgs->pControl->RedrawControl(); } CXTPReportRecordItem::OnClick( pClickArgs); } -- Best regards, Sergey |
|
![]() |
|
Arnie
Newbie
Joined: 04 March 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 March 2005 at 6:00am |
|
Thanks Sergey, I got it to work with one change to your code. I had to remove SetChecked(!IsChecked()); Must be because m_bChecked is set by
|
|
![]() |
|
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 |