I have a screen with a gallery on the left, a display form on the right, and the top I have filter boxes with a search bar. I have a template fill formula on the gallery that highlights the selected item. The gallery's OnSelect is set to Set(varRecord, ThisItem.ID) and the display form Item is set to LookUp(DataSource, ID=varRecord).
This setup works, but the highlighted item on the gallery does not always match the displayed item on the display form after doing a filter or a search. The gallery defaults to the first item and highlights it while the display form shows another item. This confuses some users. I came up with a fix for this that does not select any gallery items and hides the display form until an item is select. This works, but I would like to see if there is a better way to do it.
This is my fix:
1. Set the gallery's Default property to {} so that no items are highlighted/selected.
Default = {}
2. In the gallery, I have a divider that also changes color when the item is selected. I set the tooltip property to:
Tooltip = If(ThisItem.IsSelected, "Selected", "Non-Selected")
3. If the tooltip for the divider is Non-Selected for all items, the display form is hidden:
Visible = If(Gallery.Selected.Divider.Tooltip = "Selected", true, false)
The reason for using the tooltip for the divider is because I could not get anything else to work. I tried to use Gallery.Selected.Divider.Fill for the display form's visible property so that I could link it to the color of the divider, but Fill is not an option. The options are limited to AccessibleLabel, ContentLanguage, and Tooltip.
Like I said earlier, this setup that I have does work the way I want it to, but I would like to see if there is another way that makes more sense.