Hi
We have a popup gallery of employee photos that the user can use to select an employee.
There are also a couple of other ways the user can select an employee. If the user uses one of these ways, then we want to update the photo in the popup gallery preview area (as if the user selected it).
I can't find a way to do this. I've tried gallery.selecteditem and photo.bringintoview.
Thanks
I was able to do this with the SelectedItem property and BringIntoView method with this code:
PopupGalleryTool rootTool = (PopupGalleryTool)this.ultraToolbarsManager1.Tools["PopupGalleryTool1"];PopupGalleryTool instanceTool = (PopupGalleryTool)rootTool.SharedProps.ToolInstances[0];
rootTool.SelectedItem = rootTool.Items["Item5"];rootTool.SelectedItem.BringIntoView(instanceTool, null, GalleryArea.Preview);
HI
I have the same problem as Keltyx. I tried it with the solution from Mike but it didn't work. Is there a other solution for this problem.
GetPopupGalleryTool(KEY_PG_DATAINPUT_TEMPLATESELECTION).SelectedItemKey = m_oRibbonMenuViewModel.Template
If Not GetPopupGalleryTool(KEY_PG_DATAINPUT_TEMPLATESELECTION).UIElement Is Nothing Then GetPopupGalleryTool(KEY_PG_DATAINPUT_TEMPLATESELECTION).SelectedItem.BringIntoView(GetPopupGalleryTool(KEY_PG_DATAINPUT_TEMPLATESELECTION).SharedProps.ToolInstances(0), Nothing, GalleryArea.Preview)
End If
Private Function GetPopupGalleryTool(ByVal i_strKey As String) As PopupGalleryTool
Return CType(tbChannelPreCalc.Tools(i_strKey), PopupGalleryTool)
End Function
Thank you for the fast answer. I tried it with your code snipped but the popupgallery still shows the item which i have selected with the mouse. The BringIntoView function is called but it has no effect on the gallery.
Can you post a small sample reproducing the issue?
Hello Mike,
today i tried your code snipped in a little example project and it worked nice. I think this works if the UltraToolbarsManger has no MdiParentManager. In my real project i have 2 merged UltraToolbarManager an your solution has no effect on the popupgallery.
My guess is you are calling the BringIntoView method on the PopupGalleryTool from the child UltraToolbarsManager. The child tools play no part in what is displayed or what is in view. They only provide content which the parent UltraToolbarsManager can display. Try calling BringIntoView on the PopupGalleryTool merged tool that was created to host the child tool.
I tried to find the Tool in the Host UltraToolbarManager but i didn't find it. Can you please tell me where i can find the Host PopUpGalleryTool.
Hi,
Today I have installed the newest version an this issue still exists. Do you have any plans to fix it ? I think it should be possible to fix at a time span of 5 years.
regards,
Christian
This issue has been submitted to our development team for review and you will receive more information regarding the issue from the support case that has been opened for you.
Ok, after looking into this some more, it looks like an item can be hidden from the preview area if your gallery uses groups and the item doesn't belong to any group. It can also be hidden if the gallery contains filters and a filter is selected which doesn't include the item. Unfortunately, it doesn't look like there's an easy way to determine the visible items in the preview area. This can be considered a bug. I have forwarded this post to the Developer Support Manager and a DS engineer will be contacting you about this issue.
I have a a function in my Project wich is called WritePropertiestoScreen. This Function is called if i change somthing in my UI. In this this function i clear all the items from the PopUpGallery after that i fill it new. After that i check if a Item with the key xy existis in the Gallery.
If GetPopupGalleryTool(KEY_PG_CALCULATION_FIXPOINT).Items.Count > 0And Not IsNothing(m_oRibbonMenuViewModel.Fixpoint) Then GetPopupGalleryTool(KEY_PG_CALCULATION_FIXPOINT).SelectedItem = (From i As GalleryToolItem In GetPopupGalleryTool(KEY_PG_CALCULATION_FIXPOINT).Items _ Where i.Key = m_oRibbonMenuViewModel.Fixpoint).FirstOrDefault() m_bDoAgain = Not BringIntoViewSelectedPopUpGalleryItem(KEY_PG_CALCULATION_FIXPOINT) End If
Private Function BringIntoViewSelectedPopUpGalleryItem(ByVal i_strPopUpGalleryKey As String) As Boolean Dim bRet As Boolean = True If Not tbFixpoint.MdiParentManager Is Nothing Then Dim rootTool As PopupGalleryTool = CType(tbFixpoint.MdiParentManager.MergedTools.Item(i_strPopUpGalleryKey), PopupGalleryTool) For Each instanceTool As ToolBase In rootTool.SharedProps.ToolInstances If Not instanceTool.UIElement Is Nothing And TypeOf instanceTool Is PopupGalleryTool Then Try If GetPopupGalleryTool(i_strPopUpGalleryKey).Owner.Visible And CType(instanceTool, PopupGalleryTool).Items.Contains(rootTool.SelectedItem) Then rootTool.SelectedItem.BringIntoView(instanceTool, Nothing, GalleryArea.Preview) Else bRet = False End If Catch ex As Exception bRet = False End Try Else bRet = False End If Next End If Return bRet End Function
The m_bDoAgain is for the timer. I have a timer and if m_bDoAgain is true i call the function BringIntoView again.