How can I use Kendo Button Group with Reactive form?

1 Answer 585 Views
Button ButtonGroup Forms
Srinivas
Top achievements
Rank 2
Iron
Veteran
Iron
Srinivas asked on 10 Aug 2021, 12:34 PM

Hi Team,

I'm creating one module to apply the style dynamically.
In that I'm using form as reactive form.
I used Kendo Button Group to select font weight & style like bold, italic and underline.
For the same I used BIU as different button in button group.
But I'm not able to apply the formControlName.

How can I do that?

 

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 13 Aug 2021, 07:34 AM

Hi Srinivas,

In general, the ButtonGroup component isn't based on an input control which has a value. This is why the ButtonGroup or the Buttons components don't support Angular forms. Consequently the ButtonGroup doesn't allow to be bound to an Angular FormControl.

Regards,
Svet
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/.

Srinivas
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 14 Aug 2021, 01:38 AM

Hi Svet,

Your right but there should be some way to handle this kind of issues.

Regards,
Srinivas M. P.

Svet
Telerik team
commented on 18 Aug 2021, 11:02 AM

Hi Srinivas,

Could you provide some more details as to what is the end result that you would like to achieve for the ButtonGroup? Thank you. That will allow me to better understand the requirement and I will try to suggest something different than binding the ButtonGroup to a FormControl. I am looking forward to your reply.

Srinivas
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 19 Aug 2021, 01:35 AM

Hi Svet,

I want to get & set the data using reactive form module for ButtonGroup nothing else.

Regards,

Srinivas M. P.

Svet
Telerik team
commented on 23 Aug 2021, 07:58 AM

Hi Srinivas,

Thank you for the provided latest details.

The selected state of the buttons within a ButtonGroup can be programmatically controlled via the [selected] input property of the buttons.

I understand that this may be disappointing, but there isn't a way to control the state of the buttons via a FormControl due to the earlier mentioned limitations.

Tags
Button ButtonGroup Forms
Asked by
Srinivas
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Svet
Telerik team
Share this question
or