Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Combo DropDown/Gallery selection issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combo DropDown/Gallery selection issue

 Post Reply Post Reply
Author
Message
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Topic: Combo DropDown/Gallery selection issue
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2007 at 9:13am

Hi Oleg,

I've not had much luck with this.

Thx

Back to Top
rupert View Drop Down
Newbie
Newbie


Joined: 28 August 2007
Location: United States
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote rupert Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2008 at 9:55am
Hi,
Please check our sample. See how ID_GALLERY_STYLES works.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rupert View Drop Down
Newbie
Newbie


Joined: 28 August 2007
Location: United States
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote rupert Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
rupert View Drop Down
Newbie
Newbie


Joined: 28 August 2007
Location: United States
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote rupert Quote  Post ReplyReply Direct Link To This Post 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?
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
rupert View Drop Down
Newbie
Newbie


Joined: 28 August 2007
Location: United States
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote rupert Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.