Combo DropDown/Gallery selection issue |
Post Reply |
Author | |
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
Posted: 20 December 2007 at 12:55pm |
i am trying to create a combo dropdown with gallery.
'----- Init code-----------
Set oCtlCmbMode = GroupRecordMode.Add(XtremeCommandBars.XTPControlType.xtpControlComboBox, ID_SESSION_TYPE, "")
With oCtlCmbMode .Style = xtpButtonIconAndCaption .Width = 150 End With Set ItemsSession = CommandBars.CreateGalleryItems(ID_SESSION_TYPE) ItemsSession.Icons = Me.ImageManagerAnnotations.Icons ItemsSession.ItemWidth = 400 ItemsSession.ItemHeight = 50 ItemsSession.AddItem ID_REC1, "Record A" Set GallerySession = oCmbSessionPopup.Controls.Add(xtpControlGallery, ID_SESSION_TYPE, "") Set oCtlGallerySession = GallerySession Set oCtlCmbMode.CommandBar = oCmbSessionPopup The issue i have here is that evrytime the dropdown is clicked, it will always select the first item in the gallery irrespextive of the selection in the dropdown. How can i address this? Thx. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You need set checked item in update handler. Our samples show it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
indices
Groupie Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Hi Oleg, I've not had much luck with this. Thx |
|
rupert
Newbie Joined: 28 August 2007 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Hi Oleg,
I am using the example above and as you suggested I added an update handler. But it does not work.
I've created the handler as follows:
Select Case Control.ID
Case ID_SESSION_TYPE If (Control.Type = xtpControlGallery) Then set Control.CheckedItem=Control.SelectedItem End If
End Select What is wrong? I don't see the gallery firing any update events
Thx
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Please check our sample. See how ID_GALLERY_STYLES works.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
rupert
Newbie Joined: 28 August 2007 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
|
it only works realiably if DropDownListStyle = False for the combo box. If true, it works weirdly. The problem with setting it to false is that user can type anything into the combo box. Any ideas?
|
|
rupert
Newbie Joined: 28 August 2007 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Hello Oleg, This issue can be reproduced in the VB project - Ribbon Sample, by making the following change:
In the CreateRibbonBar routine, change
Dim Combo As CommandBarComboBox
Set Combo = GroupFont.Add(xtpControlComboBox, ID_FONT_FACE, "Font Face") Combo.DropDownListStyle = True to
Dim Combo As CommandBarComboBox
Set Combo = GroupFont.Add(xtpControlComboBox, ID_FONT_FACE, "Font Face") Combo.DropDownListStyle = False Now, run the example. Everytime you click on the dropdown for font face it will always select the 1st item in the list and revert to the selection made when it is closed.
This is a bug according to me. Can you suggest a fix?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
When you change it to False you must add Update handler to check corresponded item. See ID_GALLERY_STYLES handler.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
rupert
Newbie Joined: 28 August 2007 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
|
It doesn't work. I've confirmed that the gallery checked item is getting the correct ID. Yet the problem persists, every time the dropdown is clicked, the first item in the gallery is selected in the combo box.
|
|
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 |