Can this also be easily done in a context menu?
4 Answers, 1 is accepted
There is no such built-in functionality, actually the close buttons on the tabs are not built-in and are application specific logic, so you should do this on your own (i.e. modify the ControlTemplate of the RadTabControl and add your specific logic).
Regards,
Viktor Tsvetkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Can you provide an example of this?
I've thought about adding an item to our RadTabControl that's hidden somehow, making it's title "Close All Tabs", but this is a straight-up hack. I'd rather use something a bit more elegant.
To achieve this, I would suggest subclassing the RadTabControl and extending its logic. For example, you can create a DelegateCommand (or any other command) as a property of the customized tab control. Then you can edit the default control template and place a button and bind it to this custom close command. As the command is inside the tab control itself, you would have access to the container generator of the control, so that you can handle both Items and ItemsSource scenarios to get the containers and remove or hide them. This approach will also make the control reusable.
Please let us know if you need further assistance.
Alex Fidanov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.