Telerik Forums
UI for Blazor Forum
1 answer
32 views

ToolBarItemBase exposes Class and other Parameters via it's inheritance, but dosn't implement them. This causes problems when you want to for example add Class="k-grow" in the ToolBarTemplateItem and TelerikTextBox to make if swell and fill the toolbars remaining space.

Sample Code:

@page "/home"

<TelerikToolBar>
	<ToolBarTemplateItem Class="This-Class-Is-Not-Rendeder-In-Browser-DOM">
		<TelerikTextBox Class="This-Class-Works-Fine" />
	</ToolBarTemplateItem>
</TelerikToolBar>

DOM:

<main class="main" b-29r974uz1l="">
    <div class="k-toolbar telerik-blazor k-toolbar-resizable k-toolbar-md" role="toolbar"
        data-id="e665969e-a55f-4bb1-8503-427f659bc6ab" dir="ltr">
        <div class="k-toolbar-item" tabindex="0">
            <span class="k-textbox k-input This-Class-Works-Fine telerik-blazor k-input-solid k-rounded-md k-input-md">
                <input role="textbox" id="8152979c-ef9b-47f2-9315-acdc5fb5ac38"
                    data-id="a24df6d2-8ce8-4ee3-bd68-3d27283b8bfd" class="k-input-inner" dir="ltr" aria-readonly="false"
                    tabindex="0">
            </span>
        </div>
        <button
            class="telerik-blazor k-button k-toolbar-overflow-button k-hidden k-button-flat k-rounded-md k-button-md k-button-flat-base k-icon-button"
            data-id="1aeae0a0-1a66-404e-914d-2cd4ddba222d" dir="ltr" tabindex="-1" title="More tools"
            aria-disabled="false" type="button">
            <span class="telerik-blazor k-button-icon k-icon k-svg-icon k-svg-i-more-vertical" aria-hidden="true">
                <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
                    viewBox="0 0 512 512">
                    <path
                        d="M240 128c26.4 0 48-21.6 48-48s-21.6-48-48-48-48 21.6-48 48 21.6 48 48 48m0 64c-26.4 0-48 21.6-48 48s21.6 48 48 48 48-21.6 48-48-21.6-48-48-48m0 160c-26.4 0-48 21.6-48 48s21.6 48 48 48 48-21.6 48-48-21.6-48-48-48">
                    </path>
                </svg>
            </span>
        </button>
    </div>
</main>

ToolBarTemplateItem.razor from your source code dosn't seem to have any actual implementation for this in the razor file, nor do I see any BuildRenderTree functions in any of the inhertied classes. I assume this is the problem. Or am I missing something?

@namespace Telerik.Blazor.Components

@inherits ToolBarItemBase

Hristian Stefanov
Telerik team
 answered on 13 Jan 2025
2 answers
55 views

Hello
I want to write a desired text instead of calendar numbers.
For example, as specified in the attached file, I want to write the desired text (8 day of month) instead of the number 8.
I tried through the event:
OnCalendarCellRender="@OnCalendarCellRenderHandler"
but I did not get the result.
Please help me.

 

Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 13 Jan 2025
1 answer
79 views

Going back to 2020 threads I researched and there is still no way I can tell for easily hiding a GridCommandButton (even when using context)?

What is odd, the "ShowInEdit" will indeed hide the GridCommandButton if row selected and in edit mode ... so it seems  you folks have a way to control visibility but no property for it?

So I'm assuming after 4 years of Blazor UI support, a "visibility" property will NOT happen?

Currently this is what I use to "Enable" a GridCommandButton but that's not really what I want to do, I don't want to show it.

                            <GridCommandColumn Context="bookingEquipmentDeleteCommandContext" Width="8rem">
                                @{
                                    var equipment = bookingEquipmentDeleteCommandContext as BookingEquipmentModel;
                                }
                                <GridCommandButton Command="Delete" OnClick="@EquipmentDeleteCommandHandler" Class="btn-red" Icon="@FontIcon.Trash" Enabled="@(string.IsNullOrEmpty(equipment?.EquipmentCode))" ShowInEdit="false">Delete</GridCommandButton>
                            </GridCommandColumn>

I would think something as simple as "Visible" would be easy to implement, especially now that we're on version 7 on the control suite?

Rob.

Hristian Stefanov
Telerik team
 answered on 10 Jan 2025
1 answer
90 views

I am trying to clear all selected values from a TelerikRadioGroup.  I would like to do this by clicking on the selected value.  The problem is the OnChange and the ValueChanged does not fire unless you are clicking on a different value. 

 

<TelerikRadioGroup Data="@genderOptions"
                   Value="@selectedGender"
                   OnChange="@OnChangeHandler"
                   ValueChanged="@((int newValue) => OnGenderChanged(newValue))"
                   ValueField="@nameof(GenderModel.GenderId)"
                   TextField="@nameof(GenderModel.GenderText)"
                   Layout="RadioGroupLayout.Horizontal">
</TelerikRadioGroup>

 

@code {

private int selectedGender;

private void OnGenderChanged(int newValue)
{
    if (selectedGender == newValue)
    {
        var aa = 123;

    }
    else
    {
        selectedGender = newValue;
        Console.WriteLine($"Gender changed to: {newValue}");


    }

}

async Task OnChangeHandler(object newValue)
{
    // the handler receives an object that you may need to cast to the type of the component
    // if you do not provide a Value, you must provide the Type parameter to the component
    Console.WriteLine($"ValueChanged fired with value: {newValue as string}");
}

}

 

Hristian Stefanov
Telerik team
 answered on 10 Jan 2025
1 answer
50 views

Dear Telerik Support team,

as of version 7.1.0 the No Data Template was introduced for Charts and I was wondering, if there's any chance to prevent the chart of rendering the no data template, when none is defined and needed.

In my case I'd rather display an empty chart, instead of the no data template.

Any way to accomplish that?

Many thanks!
Thomas

Tsvetomir
Telerik team
 answered on 10 Jan 2025
1 answer
98 views
I'd like to add a kebab menu as the last column for each row in my grid that will show a menu of further actions for that row. I found a sample showing how to do a context menu for each row but can't find anything on how to create a custom column with other controls in it (like the DropDownButton).
Marco
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 09 Jan 2025
1 answer
83 views

We have a legacy ASP.NET Core MVC app and are migrating it to Blazor Interactive Server one view/page at a time. We have Blazor Interactive Razor Components in a MVC Razor View working. What is the guidance on the TelerikRootComponent in this scenario? There is no Blazor interactive layout file to place it in w/ this use case.

<div class="alert alert-dark" role="alert">
    This is an ASP.NET Core MVC Razor View/Page.
</div>

<div class="card">
    <div class="card-header">
        Blazor Interactive Server Component
    </div>
    <div class="card-body">
        <component type="typeof(MyWeb.Components.Tests.Test)" render-mode="ServerPrerendered" />
    </div>
</div>

Hristian Stefanov
Telerik team
 answered on 09 Jan 2025
1 answer
96 views

Hi, I am wondering if anyone has attempted this before and if it's possible. I have a use case where a user can click on a grid to expand details about that row, which shows as another grid. For example, in the image I have, I expand this row, and it shows a new grid below.

When I choose export, I want to be able to export the rows I'm viewing as usual, but underneath each of those rows I want to also include the sub-grid rows. 

So for example, if an object has two sub-items in its sub-grid, the export for two objects would look like:

Object 1

        Sub Item 1

        Sub Item 2

Object 2

        Sub Item 1

        Sub item 2

I'm assuming I have to do something under OnBeforeExcelExport to stage this, but how would I go about doing it? I have no idea what the syntax in this case should look like (as a matter of fact I don't quite understand what's going on in the default version of the method). 

Any help is appreciated!

 

Hristian Stefanov
Telerik team
 answered on 08 Jan 2025
1 answer
44 views

Hello
I want to display the desired text in the DatePicker after selecting the date from TelerikDatePicker.
Currently, after selecting the DatePicker, the date is displayed in this field, to which I want to add the desired text.
For example, in the DatePicker field after selecting the date, instead of
07/01/2025
, today is 07/01/2025.

If it is not possible to change the text, at least no text should be displayed in the DatePicker after selecting the date.

Please help me.
Code and image:

 


<TelerikDatePicker @bind-Value="DatePickerValue" >
</TelerikDatePicker>

@code {
	private DateTime DatePickerValue { get; set; } = DateTime.Today;
{

Hristian Stefanov
Telerik team
 answered on 08 Jan 2025
0 answers
42 views
 <TelerikForm EditContext="EditContext" OnValidSubmit="Save" Columns="3" ColumnSpacing="15px">
     <FormValidation>
         <FluentValidationValidator />
     </FormValidation>
     <FormItems>
         <FormItem Id="fiInvoiceFooterElemenName" ColSpan="2">
             <Template>
                 <label class="k-label k-form-label" for="ddlInvoiceFooterElement">@Resources.InvoiceFooterElementName</label>
                 <TelerikDropDownList Id="ddlInvoiceFooterElementName"
                                      TItem="@InvoiceFooterElementCategory"
                                      TValue="@Guid"
                                      TextField="@nameof(InvoiceFooterElementCategory.FullName)"
                                      ValueField="@nameof(InvoiceFooterElementCategory.InvoiceFooterElementCategoryId)"
                                      Data="@invoiceFooterElementCategories"
                                      @bind-Value="@invoiceFooterElementLine.InvoiceFooterElementCategoryId"
                                      OnChange="OnChangeInvoiceFooterElementCategories"
                                    
                                      Width="100%"
                                      DefaultText="@Resources.SelectInvoiceFooterElementCategory">
                     <DropDownListSettings>
                         <DropDownListPopupSettings Height="auto" MaxHeight="250px" Width="auto" />
                     </DropDownListSettings>
                     @* <ItemTemplate>
                         <span>@($"{context.Name} ({context.Code})")</span>
                     </ItemTemplate> *@
                 </TelerikDropDownList>
                 <ValidationMessage For="@(() => invoiceFooterElementLine.InvoiceFooterElementCategoryId)" />
             </Template>
         </FormItem>
     </FormItems>
     <FormButtons>
         <button id="btnSave" type="submit" class="btn btn-sm btnAction btn-action-filled-blue mr-1 mt10">
             @if (saving)
             {
                 <span class="spinner-border spinner-border-sm mr-1"></span>
             }
             @Resources.OK
         </button>
         <button id="btnCancel" type="button" class="btn btn-sm btnAction btn-action-stroke-black mt10" @onclick="@Cancel">
             @Resources.Cancel
         </button>
     </FormButtons>
 </TelerikForm>



i am trying to prevent model close when i changes some text after that press enter key then Model close automatically
Rajkumar
Top achievements
Rank 1
 asked on 08 Jan 2025
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?