Print Page | Close Window

Combo DropDown/Gallery selection issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=9157
Printed Date: 08 October 2024 at 10:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Combo DropDown/Gallery selection issue
Posted By: indices
Subject: Combo DropDown/Gallery selection issue
Date 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"
    ItemsSession.AddItem ID_REC2, "Record B"
    ItemsSession.AddItem ID_REC3, "Record C"
   
    Set oCmbSessionPopup = CommandBars.Add("Combo Popup", xtpBarComboBoxGalleryPopup)

    Set GallerySession = oCmbSessionPopup.Controls.Add(xtpControlGallery, ID_SESSION_TYPE, "")

    Set oCtlGallerySession = GallerySession
    GallerySession.Width = 300
    GallerySession.Height = 150
    GallerySession.Style = xtpButtonIconAndCaption
    GallerySession.ShowScrollbar = False
    Set GallerySession.Items = ItemsSession

    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.



Replies:
Posted By: Oleg
Date Posted: 21 December 2007 at 1:10am
Hi,
You need set checked item in update handler. Our samples show it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: indices
Date Posted: 21 December 2007 at 9:13am

Hi Oleg,

I've not had much luck with this.

Thx



Posted By: rupert
Date Posted: 16 January 2008 at 7:10am
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


Posted By: Oleg
Date Posted: 16 January 2008 at 9:55am
Hi,
Please check our sample. See how ID_GALLERY_STYLES works.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rupert
Date Posted: 17 January 2008 at 1:56pm
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?


Posted By: rupert
Date Posted: 30 January 2008 at 7:43pm

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?
 
 


Posted By: Oleg
Date Posted: 31 January 2008 at 12:47am
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


Posted By: rupert
Date Posted: 31 January 2008 at 11:12am
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.



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