Completed
Last Updated: 17 Nov 2022 08:11 by ADMIN
Thomas
Created on: 03 Nov 2022 10:10
Category: UI for Blazor
Type: Feature Request
1
ButtonGroup, I would like to have a third SelectionMode for the ToggleButtons in the group

Currently we have 2 SelectionMode to select from in the ButtonGroup. I would like to have a third option that is a mix betwen Single and Multiple.

This third option should work like the Multiple mode but don't allow the user to deselect all ToggleButtons, like in the Single mode at least one button is allways selected. If the user clicks on the last selected Togglebutton he will not be able to deselect it.

3 comments
ADMIN
Hristian Stefanov
Posted on: 17 Nov 2022 08:11

Hi Thomas,

Thank you for getting back to us with feedback.

You can reduce the repeating SelectedChangedHandler code by extracting it in a separate method. If you want to make things even more compact, you can extract the whole TelerikButtonGroup into a separate reusable component.

Currently, the desired behavior is easily achievable, and a built-in feature does not seem needed. That said, at this stage, I confirm that both selection modes remain - "Multiple" and "Single".

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Thomas
Posted on: 10 Nov 2022 09:51

Hi,

Yes it is possible by doing it like that. But the whole point of using a component instead of doing it all by my self is to reduce the code I need to write. I would like to use the ToogleButtonGroup in MANY places with 4-5 button each time and I don't want to repeet that code every time I use the Toogle Button.

 

So yes, it is possible but then it will instead create my of ToggleButtonGroup instead of use yours. That is why I whanted this feature.

ADMIN
Hristian Stefanov
Posted on: 10 Nov 2022 09:45

Hi Thomas,

I confirm that the desired functionality (mixed selection mode) is already possible by using the SelectedChanged event of the component.

Here is an example I have prepared - REPL link. You can run and test the REPL sample to see the result.

In short, the idea is every time you deselect a button, check if it's the last selected in the SelectedChanged event handler.

Regards,
Hristian Stefanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.