Print Page | Close Window

Creating a ComboBox

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=6185
Printed Date: 19 September 2024 at 6:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Creating a ComboBox
Posted By: Shawshank
Subject: Creating a ComboBox
Date Posted: 22 January 2007 at 2:58pm
I'm trying to create a ComboBox in a ReportControl. For a specific column I want all of the rows to have a ComboBox. I tried the following at the time in which I create the columns for the RC:
 
Set column = ReportCntrl.Columns.Add(11, "xxx", 2, True) 

column.EditOptions.AddComboButton

column.EditOptions.Constraints.Add "Yes", 0
column.EditOptions.Constraints.Add "No", 1
column.EditOptions.Constraints.Add "Unknown", 2
The column does get created but no ComboBox appears once Records populate the RC. So then I tried adding Records and then adding the ComboBox to the proper ReportRecordItem like so:
 
Set Item = Record.AddItem("xxx")
 
Item.CreateEditOptions
   
Item.EditOptions.AddComboButton
Item.EditOptions.Constraints.Add "Yes", 0
Item.EditOptions.Constraints.Add "No", 1
Item.EditOptions.Constraints.Add "Unknown", 2
 
Still no ComboBox appears. Is there something I'm not doing here that causes the ComboBox to not appear?
 
JW



Replies:
Posted By: sserge
Date Posted: 22 January 2007 at 3:54pm
ComboBox is shown when you click an item and start editing.


Set column = ReportCntrl.Columns.Add(11, "xxx", 2, True) 

column.EditOptions.Constraints.Add "Yes", 0
column.EditOptions.Constraints.Add "No", 1
column.EditOptions.Constraints.Add "Unknown", 2

column.EditOptions.AllowEdit = False
column.EditOptions.ConstraintEdit = True

column.EditOptions.AddComboButton


--
WBR,
Serge


Posted By: Shawshank
Date Posted: 22 January 2007 at 5:42pm
Well, yes, I guess I should have mentioned that I did click on the item. The ComboBox still did not appear. Should I be creating the ComboBox when I create the columns as in my first code example or later, when I add Records? Given that it does not appear in either example after clicking on the Item what could I be doing wrong? Is there some attribute I need to set on the Column or ReportRecordItem for the ComboBox to appear after clicking upon it?


Posted By: sserge
Date Posted: 22 January 2007 at 6:00pm
Ensure that editing is enabled at all on your control:

.AllowEdit = True
 
--
WBR,
Serge


Posted By: Shawshank
Date Posted: 22 January 2007 at 8:39pm
Thanks, that was the ticket.



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