Dominik
asked on 10 Jan 2024, 02:22 PM
| edited on 10 Jan 2024, 02:23 PM
Hope there is a way. Thanks
Dominik
1 Answer, 1 is accepted
0
Accepted
Stenly
Telerik team
answered on 15 Jan 2024, 12:15 PM
Hello Dominik,
May I ask if you could try setting the RadToolBar.OverflowMode attached property to Never on the RadToolBarSeparator instances? This way, they will not be added to the overflow area.
Currently, this is the default behavior of the items, to which the RadToolBar.OverflowMode attached property is set to Never.
In order to hide items that have the above-mentioned property set to them, a custom logic would have to be introduced that will check if the item at the next index in the Items collection is visible.
For example, one way of achieving this would be with a custom RadToolBarOverflowPanel panel, that has the OnVisualChildrenChanged method overridden. In it, you could check, which elements are added to the overflow menu and show/hide the RadToolBarSeparator based on this information. After that, the default control template of the RadToolBar control has to be extracted and modified and the RadToolBarOverflowPanel has to be substituted with the custom one.
With this being said, I have attached a sample project, which contains a sample implementation of the above suggestion.