Telerik Forums
UI for Blazor Forum
2 answers
219 views

Hello, 

I am currently experimenting with the ChipList component and the documentation suggests that it delivers the same customization options as the Chip component. However, I am unable to find a way to change the ThemeColor of the chips. Is this feature supported, and if so, how can it be implemented?

Reference that suggests this is possible: Blazor ChipList

Customization

Built on top of the existing Blazor Chip component, the Telerik UI for Blazor ChipList delivers the same customization options to meet any design requirements. These include the color and style of the ChipList, whether to display a close or delete icon and whether to add avatars or images as part of the ChipList content.

Thanks 



Michael
Top achievements
Rank 1
Iron
 answered on 17 Jan 2025
1 answer
78 views
Hello
I need to use something like Image Button in Grid that redirects the user to another page by clicking on it.
I used the following code but I can't change its icon and put my own icon.

<GridCommandColumn>
<GridCommandButton Command="MyOwnCommand"
		Icon="@SvgIcon.InfoCircle"
		ThemeColor="@ThemeConstants.Button.ThemeColor.Tertiary"
		OnClick="@MyCustomCommandOnClickHandler">click Me</GridCommandButton>
</GridCommandColumn>
Grid is dynamic and is set with ExpandoObject.
Please help.
Thanks
Dimo
Telerik team
 answered on 16 Jan 2025
1 answer
55 views

Hi,

in a Blazor Grid with Column Virtualization and multiple ow selection enabled, when I use the "Select all" option the column virtualization doesn't load any further values on scrolling.

I took an example from the Telerik docs and added a checkbox column:

https://blazorrepl.telerik.com/QzOPbePP34Fw94E733

Is there any solution for this?

 

Best regards,

Rayko

Tsvetomir
Telerik team
 answered on 16 Jan 2025
1 answer
57 views

I'm trying to reference a TelerikComboBox in a razor component, but it keeps returning null.
(I'm using version 6.2.0)

Any clues?

Html:

<TelerikComboBox Class="hide-combobox-buttons" 
                 Data="@AllLabels" 
                 Value="@Label"
                 @ref="ComboBoxRef"
                 ValueChanged="@((string newValue)=> ValueChanged(newValue))"
                 AllowCustom="true">
</TelerikComboBox>

 

@code{

 private TelerikComboBox<string, string>? ComboBoxRef { get; set; }

 [Parameter]
 public IReadOnlyList<string>? AllLabels { get; set; }

 private string Label { get; set; } = string.Empty;

 protected override async Task OnInitializedAsync()
 {
     if (ComboBoxRef != null) //here it's always null
         await ComboBoxRef.FocusAsync();

     await base.OnInitializedAsync();
 }

}

Dimo
Telerik team
 answered on 16 Jan 2025
2 answers
121 views
Hello
I need a DatePicker with solar or Jalali or  hijri or Persian calendar.
Please help me.
Thanks
Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 15 Jan 2025
1 answer
73 views

Background: Grid bound to a List provided by EF from SQL data source.  Pageable=true. EditMode=Incell.

Process:

1.  User clicks Add button

2.  In the Add event handler for the button, a new object instance is created and added to the List that is Data bound to the grid (last item in the List not an Insert ... this is a user requirement and must be added to end of List)

3.  StateHasChange(), Grid?.Rebind 

4.  Force the grid to scroll to the last item.

I researched and found this Telerik documentation Scroll to Selected Grid Row and it suggests I have to use JavaScript "scrollIntoView()"??  I absolutely do NOT want to go this route for what should be a very simple process.  Please tell me there is a better way?

I was "hoping" I could use SelectionMode=Single and bind SelectedItemsInPage and then programmatically set the SelectedItem to the last item in the List (Data=) and Telerik Grid would do the control update to appropriate page and make the last row visible in the grid.  Unfortunately this is not the case. 

Do you folks have a more Blazor-Server like approach for .NET 9 and 7.1.0 suite?

Rob.

Dimo
Telerik team
 answered on 15 Jan 2025
1 answer
46 views

I have a DeleteHandler:

    private async Task OnDeleteAsync(GridCommandEventArgs args)

    {
        if (ViewModel == null)                    throw new InvalidOperationException("ViewModel == null");
        if (!(args.Item is ProductUi product_ui)) throw new InvalidOperationException("!(args.Item is ProductUi product_ui)");
        if (product_ui.Id == null)                throw new InvalidOperationException("product_ui.Id == null");

        var result = await ViewModel.DeleteUiAsync(product_ui.Id.Value);

        if (result.Error != null)
            await Dialogs!.AlertAsync(result.Error, "Delete Error");
    }

If there is an error I try to display it using one of Telerik's standard Dialogs.

If there is an error the dialog is displayed, however the grid then displays a busy spinner and the entire window is disabled.

There is now a deadlock, can't close the dialog because the grid has disabled input, the grid is busy because it is waiting for the dialog.

Dimo
Telerik team
 answered on 15 Jan 2025
1 answer
49 views
RIght now I'm setting the state of the TileLayout component in the OnAfterRenderAsync() method.  This results in the tiles first rendering in the default positions and then quickly switching around to the saved positions.  I do a similar thing with the Grid component using the OnGridStateInit event.  Unfortunately, the TileLayout component doesn't raise this event.
Tsvetomir
Telerik team
 answered on 15 Jan 2025
1 answer
69 views

Hi there.
I have a list of a class which contains 2 string properties, "MyValueField" and "MyTextField".
If one of the items in the list has the MyValueField property set to an empty string (in the example below it's the first item), selecting that item in the TelerikDropDownList will assign null to the binded value. Instead, an empty string should be assigned to the binded value variable.
It is worth noting that "externally" assigning the binded value variable to an empty string (either on initialization or through a button) will successfully work and the TelerikDropDownList component will display the selected item.

The following gif showcases the binded value variable becoming null when the item with MyValueField set to an empty string is selected through the TelerikDropDownList: https://i.gyazo.com/3d75359334d900a74334ae6de2493576.mp4
The following gif showcases the binded value variable becoming an empty string when pressing a button that sets it to one, and gets set to null when the first item in the TelerikDropDownList is selected: https://i.gyazo.com/12ee88a8e161f8c3b5a023d8fbc44a28.mp4

Here is the REPL link: https://blazorrepl.telerik.com/GfYbuCFt318IzZzv41
This also affects the ComboBox component: https://blazorrepl.telerik.com/czOPYjFf04sX7cIW36

Dimo
Telerik team
 answered on 14 Jan 2025
1 answer
37 views

Blazor, .net 6.0, Telerik.UI.for.Blazor 5.1.1

I have a Blazor app with a page that contains a TelerikGrid (using inline edit) with 2 columns that use TelerikDropDownList that cascade.  When no option is selected in the parent ddl, then the child ddl has no items and is disabled (enabled = false).  When an item is chosen in the parent ddl, then the child ddl has its list of options updated.  However, the child ddl is not refreshing until the user clicks somewhere in the row being edited.  Once clicking anywhere in the row, then the child ddl displays properly:  1) becomes enabled, 2) contains the new list, 3) wipes out any previously selected value.

Other than that initial refresh, the code works.  It saves, it updates the child options, etc.

No matter what I do, I cannot seem to get it refresh the child ddl without first clicking on the row.  I have all different combinations of HasStateChanged(), ddl.Rebind(), ddl.Refresh(), ddl.DropDownList_Focus().  None of these seem to have made a difference.

Below is the relevant code portions.

<GridColumn Title="Module" Field="ModuleId" Visible="isFileLocationRequired">
    <EditorTemplate>
        @{
            var editingFileType = context as FileType;
            <TelerikDropDownList Data="@SelectableModules"
                                 TextField="TextValue"
                                 ValueField="FieldId"
                                 @bind-Value="editingFileType.ModuleId"
                                 OnChange="UpdateSelectableFileLocations">
            </TelerikDropDownList>
        }
    </EditorTemplate>
</GridColumn>
<GridColumn Title="File location name" Field="FileLocationId" Visible="isFileLocationRequired">
    <EditorTemplate>
        @{
            var editingFileType = context as FileType;
            <TelerikDropDownList Data="@SelectableFileLocations"
                                 TextField="FileLocationName"
                                 ValueField="FileLocationId"
                                 @bind-Value="editingFileType.FileLocationId"
                                 Enabled="@editingFileType.ModuleId.HasValue">
            </TelerikDropDownList>
        }
    </EditorTemplate>
</GridColumn>

 

    private List<FileLocations> SelectableFileLocations = new();
    private List<FieldOptions> SelectableModules = new();
    private void UpdateSelectableFileLocations(object input)
    {
        int? moduleId = input as int?;
        SelectableFileLocations = FileLocations
            .Where(fileLocation => fileLocation.CategoryId == moduleId)
            .ToList();
    }
Dimo
Telerik team
 answered on 14 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?