Telerik Forums
UI for Blazor Forum
1 answer
29 views

Hi

Is there a better way to add an automated permission than replacing an existing component type?
How else can I automatically check permissions on the base component "TelerikButton" instead of "MyTelerikButton"?
With a large number of thousands of fields, it does not want to fill the Enable/Visible per field.

My question is not only about permissions, but also about the ability to extend TelerikButton with its my additional [Parameter] which is not included in the basic set.

I would be grateful if you could suggest a better solution.

@foreach (var item in ListOfItemNames.Take(200))
 {         
     <div class="row">
         <div class="col">
             <label for="@item">@item</label>
             <MyTelerikButton Id="@item" Form="Device" Icon="SvgIcon.Stop" Title="@item" OnClick="@ButtonAction" ButtonType="ButtonType.Button" />
             <MyTelerikTextBox Id="@item" Name="Device"  Value="@item"></MyTelerikTextBox>
             @* ...<Telerik...> etc *@
         </div>
     </div>
 }

My Component

public  class MyTelerikButton: TelerikButton
{
   
    [CascadingParameter (Name = "Privileges")]
    public required List<Privilege> Privileges { get; set; } = [];

    protected override void OnInitialized()
    { 
        base.OnInitialized();
        var buttonName = Form + Id;
        Enabled = Privileges.Any(x=>x.Code == buttonName);       

    }
}

 

Dimo
Telerik team
 answered on 27 Nov 2023
3 answers
2.8K+ views

Hi Team,

 

Could you please suggest to do Copy Clipboard on Button click in blazor?

 

Thanks,

Vishnu 

Peter
Top achievements
Rank 2
Iron
 answered on 28 Nov 2022
1 answer
84 views

I generated a new stylesheet using the Telerik Themebuilder and specified that the border-radius should be 0px, but after using the stylesheet in my project, I saw that all my buttons have a border-raduis, which is not the desired effect. Upon further inspection, I saw that this HTML is generated from my TelerikButton.

HTML:

<button class="telerik-blazor k-button k-button-solid k-rounded-md k-button-rectangle k-button-md k-button-solid-primary k-disabled" id="contracten-laden-button" data-id="eaee6bb5-7628-4584-861d-c02fe6f432a1" tabindex="-1" aria-disabled="true" disabled="" type="submit">
        <span class="k-button-text">Contracten laden</span>
</button>

TelerikButton:

<TelerikButton ThemeColor="@ThemeConstants.Button.ThemeColor.Primary">
    Contracten laden
    <TelerikLoader ThemeColor="@ThemeConstants.Loader.ThemeColor.Light" Type="@LoaderType.Pulsing" Visible="@IsContracteringsStatussenLoading" />
</TelerikButton>

 

Upon further inspection, I saw within the computed style (in the Developer tools) that the radius is coming from the stylesheet file which I just generated. More specifically, the .k-rounded-md class, which gives a border radius of 4px. It seems like, currently, it is not possible to generate a css file with a border-radius of 0. I suppose that I have to manually change these values, but I fear that I may break some other functionality.

 

Could you please suggest possible solutions? Perhaps specify which classes I could change to 0px to ensure that nothing else breaks. 

 

Thank you in advance for your response. I have attached all the files which were generated from the themebuilder, just for completion. 

 

Kind regards,

Natasha

Joana
Telerik team
 answered on 08 Sep 2022
1 answer
90 views
I saw the FloatingActionButton Web control available in KendoUI and ASP.NET Core.  Is the FloatingActionButton coming to UI for Blazor?
Marin Bratanov
Telerik team
 answered on 06 Mar 2022
1 answer
303 views

Hi

 

Is Focus is available for Telerik Button? 

Could you please suggest on this?

 

Thanks,

Vishnu Vardhanan H

Hristian Stefanov
Telerik team
 answered on 27 Aug 2021
1 answer
101 views

Hi,

 

On Clicking Space from Keyboard need to perform Button click event.

<EditForm OnValidSubmit="@OnFormValidSubmit" Model="@Model">
            <TelerikButton Icon="save" ButtonType="@ButtonType.Submit" Primary="true">Upgrade</TelerikButton>
            <TelerikButton Icon="cancel" ButtonType="@ButtonType.Button" OnClick="@OnCancelClick">Cancel</TelerikButton>
   </EditForm>

Thanks,

Vishnu Vardhanan H

Nadezhda Tacheva
Telerik team
 answered on 27 Aug 2021
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?