Print Page | Close Window

AddComboButton behaviour

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18624
Printed Date: 15 November 2024 at 5:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: AddComboButton behaviour
Posted By: AlbertoB
Subject: AddComboButton behaviour
Date Posted: 06 July 2011 at 8:17am
Hi,
 
I have a report control with some cells that are combo boxes.
My problem is that it only works to double click the cell to expand de combo options.
 
Is there any property or any way to set the combo cell to expand just with a single click in the combobutton?
 
I got a sample from this thread in the forum
http://forum.codejock.com/forum_posts.asp?TID=15588&title=m-bshownonactiveinplacebutton - http://forum.codejock.com/forum_posts.asp?TID=15588&title=m-bshownonactiveinplacebutton
 
wich does exactly what I need in the column From.
 
I'm using version 13.4 and the sample is with version 13.2
Could it be a different behaviour in my version?
 
This is a snipet of my code in case it helps
 
grid->FocusSubItems = VARIANT_TRUE;

grid->PaintManager->ShowNonActiveInPlaceButton = VARIANT_TRUE;

XRC::IReportRecordItemEditOptionsPtr editOptions= record->Item[1]->EditOptions;

editOptions->ConstraintEdit = VARIANT_FALSE;

editOptions->Constraints->Add("Value1", 0);

editOptions->Constraints->Add("Value2", 1);

editOptions->Constraints->Add("Value3", 2);

editOptions->AllowEdit = VARIANT_FALSE;

editOptions->AddComboButton(VARIANT_TRUE);

Any ideas?

Thank you.
AB.



Replies:
Posted By: Fredrik
Date Posted: 06 October 2014 at 7:46am
Hi, 

I just would like to bump this issue since I now have the same problem. 

Basically, if I click the arrow on a combo box I'd like the combo box to expand instead of having to click twice (This with the properties m_bShowNonActiveInPlaceButton TRUE and having editable combo box items.)

To reproduce, use ReportSample.exe, click Report Control >  Quality assurance > ComboBox. Check the box for "Show non-active inplace buttons".  Try clicking the combo box arrows in the two first columns.

Does anyone has a solution/workaround for it? 
CodeJock: is this anything that is planned to be fixed? 

Cheers,


-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0


Posted By: olebed
Date Posted: 06 October 2014 at 11:50am
Hi Fredrik,

You can use flag CXTPReportRecordItemEditOptions::m_bExpandOnSelect  (IReportRecordItemEditOptions.ExpandOnSelect)  for this purpose.
CXTPReportRecordItemEditOptions *pEditOptions = pColumn->GetEditOptions();
  pEditOptions->m_bExpandOnSelect = TRUE;

But expanding occurs when you click on any part of report cell.

Regards,
 Oleksandr Lebed


Posted By: Fredrik
Date Posted: 10 October 2014 at 11:35am
Great, thanks Oleksandr. 

I see this option was added in 16.3.1. I will try it out when 16.4.1 is released (hopefully soon ;-)). 

But I still would like to add it as a wish that a click in the edit field edits the text and a click on the combo box arrow expands the combo box instead of just setting focus to the edit field.

Best regards,
Fredrik


-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0


Posted By: Fredrik
Date Posted: 27 October 2014 at 4:39pm
Hi, I just tried 16.4.0. Shouldn't

CXTPReportRecordItemEditOptions* CXTPReportRecordItem::GetEditOptions(CXTPReportColumn* pColumn)
{
if (m_pEditOptions)
return m_pEditOptions;

if (pColumn)
return pColumn->GetEditOptions();
...

be

CXTPReportRecordItemEditOptions* CXTPReportRecordItem::GetEditOptions(CXTPReportColumn* pColumn)
{
if (pColumn)
return pColumn->GetEditOptions();

if (m_pEditOptions)
return m_pEditOptions;

...

?
Right now I did not get the m_bExpandOnSelect to work without modifying pColumns->GetEditOptions(nullptr) first (I thought I could just modify the edit options from CXTPReportColumn* given by AddColum()).

But as a solution to my original question, this does not work. I want to expand the the combo box when I click on the combo box arrow (as combo boxes usually work) and be able to enter a new value if I click in the edit field portion of the cell. With m_bExpandOnSelect  set, I cannot enter a new value. So AllowEdit does not work with this flag set. 

Regards, 
Fredrik



-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0



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