Telerik Forums
UI for Blazor Forum
1 answer
25 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
0 answers
27 views

In a TelerikSplitter when I click a button that causes data to load, every element at that level and lower gets the attribute tabindex="-1" for a split second and then the property is removed. Is there any function of the Splitter or Loader/LoaderContainer that would do this? This causes explicitly set tabindex attributes to be completely removed.

Update/Solution: 

I determined that this was the result of an intermediate Blazor component calling some JavaScript to disable tabbing on load. This issue is unrelated to the Telerik LoaderContainer.

David
Top achievements
Rank 1
 updated question on 23 Oct 2023
1 answer
96 views

Hi, 
I'm upgrading my Telerik version to 4.6.0 and when I want to use custom FontIcon the icon is not displayed. I see in the HTML that my icon content is defined the same in both situations.

It work with the FontIcon.FilterClear but not with the custom:

<TelerikButton Icon="@FontIcon.FilterClear"> Font Icon Button <TelerikButton />

<TelerikButton Icon="@("k-icon k-i-filter-clear")">Custon Font Icon Button<TelerikButton />

Dimo
Telerik team
 answered on 13 Oct 2023
1 answer
56 views

<div class="btn-toolbar mb-2 mb-md-0">
            <div class="btn-group mr-2">
                <TelerikButton  Icon="Calendar" Primary="true"  OnClick="@(_ => DateRangeFilter(3))">3 Months</TelerikButton>

 Icon="Calendar" Primary="true" - both of the properties tell it does not exist in the current context.

               
Georgi
Telerik team
 answered on 30 Aug 2023
1 answer
112 views

I would like to use a third party set of SVG images for buttons. I was hoping I could do something like:

<GridCommandButton Command="View" Icon="@/assets/magnifying_glass.svg" >View</GridCommandButton>

 

 

Georgi
Telerik team
 answered on 26 Jul 2023
1 answer
135 views

Is this possible?   

I have seen the documentation on highlighting rows, but I haven't seen anything around getting a row to highlight outside of row selection and checkbox selection.

Radko
Telerik team
 answered on 12 Jun 2023
1 answer
104 views

Hello,

   I want to set the value of a tool tip based on a value of an item in my grid.  I have tried this, but I get an error:


This is above all HTML taken from an example
<TelerikTooltip TargetSelector=".tooltip-target">
</TelerikTooltip>


        <GridColumn Editable=false Locked=true Visible="@isIDVisible" Field=@nameof(ProductDto.ProductId) Title="ID" Width="150px">
           <Template>
               @{
                     var item = (ProductDto)context; 
                }
               <TelerikButton ThemeColor="success" OnClick="() => SetAmtToAnotherCol(item)">Test</TelerikButton>
               <br />
            <TelerikButton FillMode="link" ThemeColor="info" Class="tooltip-target" 
                           Title="(@item.UnitsInStock < 0) ? 'neg' : 'pos'"
                           OnClick="() => SetAmtToAnotherCol(item)">@item.UnitsInStock</TelerikButton>
           
           </Template>
        </GridColumn>

I receive this error:

RZ9986

Component attributes do not support complex content (mixed C# and markup). Attribute: 'Title', text: '(item.UnitsInStock < 0) ? 'neg' : 'pos''

 

 

If I simply do this, it works:

Title=@item.UnitsInStock.ToString()

Is there a way for me to set a string based on a value?

 

 

Jim
Top achievements
Rank 1
Iron
 answered on 24 Apr 2023
0 answers
95 views
For the Telerik UI For Blazor, I need to prevent the button from refreshing the page and for a textbox I need to format it as a phone number. I could not find answers to this in the documentation or searching the internet. It keeps referring me back to Kendo UI. How can I achieve this?
Richard
Top achievements
Rank 1
 asked on 02 Apr 2023
1 answer
76 views

I have an EditForm with some simple attributes that I would like to edit. The TelerikButtons, Abort and Save, are directly implemented and call the necessary business logic.

 

 

But now I would also like to implement the EditForm as a TelerikDialog popup to quickly record data. Sadly, the buttons are duplicated.
How should I go about not duplicating the functionality? Can I somehow move them or redirect the dialogbuttons to call them?



<TelerikDialog Visible="@IsAssetCreationVisible" ButtonsLayout="@DialogButtonsLayout.End" Width="30%">
    <DialogContent>
    <GameAssetCreatePage AssetType="AssetType.Text"></GameAssetCreatePage>

    </DialogContent>
    <DialogButtons>
        <TelerikButton>Abort</TelerikButton>
        <TelerikButton Id="@GameAssetCreatePage.EditFormId" 
                       ButtonType="ButtonType.Submit" 
                       ThemeColor="@ThemeColor.Primary">Save and Close</TelerikButton>
    </DialogButtons>
</TelerikDialog>

Hristian Stefanov
Telerik team
 answered on 15 Feb 2023
1 answer
254 views
I've made the appropriate changes in all cases but this one -- What would be the correct change here? 
<TelerikButton Class="mr-1" ButtonType="@ButtonType.Button" ImageUrl=@GetImageUrl(@name) OnClick="@(()=>AttachmentOnClickHandler(name))">@name</TelerikButton>

Nadezhda Tacheva
Telerik team
 answered on 20 Jan 2023
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?