Ticket T834791
Visible to All Users
Duplicate

Ribbon Gallery scrolls when Action is disabled or enabled

created 5 years ago

Dear DevExpress support team,

please take a look at the attached project. There we have a ribbon gallery with two rows.
Scroll down to the second row, then click the bar button to disable Action4.
The gallery scrolls back, to the first row.

I think, this should not be the behavior. Maybe after executing Action4
the user likes to do the same action again, even if for example the Action1 gets disabled,
during the process.

Is there a way to change that?

If not, can you change it in the ribbon code? Because if you take a look at the behavior e.g.
of the Office ribbons, there is no change in the scroll position if an
item gets enabled or disabled. See e.g. QuickSteps in Outlook.

Thank you very much and kind regards

Comments (1)

    Here's the executable too. Maybe it's of use

    Answers approved by DevExpress Support

    created 5 years ago (modified 5 years ago)

    Hello,

    In this case the gallery is visually recreated, so the index of the first row is lost. The most appropriate solution I found is to restore it back:

    Delphi
    type TdxRibbonGalleryControlAccess = class(TdxRibbonGalleryControl); TdxInRibbonGalleryControlViewInfoAccess = class(TdxInRibbonGalleryControlViewInfo); procedure TForm1.Action5Execute(Sender: TObject); var AIndex: Integer; AViewInfo: TdxInRibbonGalleryControlViewInfoAccess; begin if (dxRibbonGalleryItem1.Links[0].Control is TdxRibbonGalleryControl) and (TdxRibbonGalleryControlAccess(dxRibbonGalleryItem1.Links[0].Control).ViewInfo is TdxInRibbonGalleryControlViewInfo) then begin AViewInfo := TdxInRibbonGalleryControlViewInfoAccess(TdxRibbonGalleryControlAccess(dxRibbonGalleryItem1.Links[0].Control).ViewInfo); AIndex := AViewInfo.TopVisibleRow; Action4.Enabled := not Action4.Enabled; dxRibbon1.BeginUpdate; AViewInfo.DoScrolling(AIndex); dxRibbon1.EndUpdate; end; end;
      Show previous comments (2)

        OK, I tried to implement your suggestion. Sadly to get this to work, I would have to encapsulate every ActionListUpdateState in your function, and call it where Action4.Enabled := not Action4.Enabled; is in the example.

        While this would not be a very nice solution concerning the code style/flow, it also does not work.
        When I do this, I can't scroll any more in the gallery, because the ActionlistUpdateState is called while the scrolling animation is executing and the scroll position is reset.

        So, I'm asking you: Could you please create a feature request / bug fix for this problem and the next version?
        I think the gallery should not be completely "visually recreated" or the scroll position should be remembered if this is done.

        What d you think?

        Thank you very much

        DevExpress Support Team 5 years ago

          We will try to find a better solution in the context of the t848069 ticket. However, I cannot guarantee that we will be able to do this in our next version.

            This is great to hear. Thank you very much.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.