Telerik Forums
UI for Blazor Forum
1 answer
243 views

My scenario is: When the user starts making changes, I am showing a warning notification to the user to not forget to hit save. After the user presses save, I want to make that notification disappear if it is still visible and the user haven't closed it themselves yet.

Please let me know if its possible to do so.

Thanks,

Alex

Marin Bratanov
Telerik team
 answered on 24 Feb 2022
0 answers
181 views

I have a TreeView with checkboxes.

How can I hide a checkbox for a parent node?

 

also, is there CheckedChanged event ?

Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
 updated question on 24 Feb 2022
1 answer
1.4K+ views

 

In the main MS Blazor docs there is an article Avoid rerendering after handling events without state changes

They give an example of using a button click - eg

<button @onclick="EventUtil.AsNonRenderingEventHandler<MouseEventArgs>(HandleClick3)">
    Select me (Avoids Rerender and uses <code>MouseEventArgs</code>)
</button>

private void HandleClick3(MouseEventArgs args)
{
    dt = DateTime.Now;

    Logger.LogInformation(
        "This event handler doesn't trigger a rerender. " +
        "Mouse coordinates: {ScreenX}:{ScreenY}", 
        args.ScreenX, args.ScreenY);
}

How can this be applied to say the TelerikNumericTextBox ValueChanged event?

For example, the following gives errors

<TelerikNumericTextBox T="int" Value="@NumericTextBoxValue"

ValueChanged="EventUtil.AsNonRenderingEventHandler<int>(NumericTextBoxChangeHandler)"

Min="1" Max="120" Width="120px">

</TelerikNumericTextBox> private void NumericTextBoxChangeHandler(int newValue) { Console.WriteLine($"newValue == {newValue}"); NumericTextBoxValue = newValue; }

 

Is this possible in Telerik Blazor? Or is there another inbuilt mechanism to control which events automatically invokes StateHasChanged?

Nadezhda Tacheva
Telerik team
 answered on 24 Feb 2022
1 answer
637 views

Hello, I'm programmatically setting the selected list (/from/ the available selection) on a MultiSelect.

It's bound to a List<string> that is part of a class: data.Value.

The MultiSelect is part of a "child" component that I use on more than one page.

On initial load, the List<string> that it is bound to is freshly instantiated in the class: public List<string> Value {get; set; } = new();

The very first time the code populates the list, the UI properly reflects the associated names (using key/value pairs from a dictionary).

After that, the UI doesn't change with further updates to the list.

My original code had Value.Clear() and then Value.Add(<new string values>) as required.

On a hunch, I changed it to re-instantiate the List instead of Value.Clear(), and now the UI refreshes as I expect it to.

I see the example https://docs.telerik.com/blazor-ui/components/multiselect/refresh-data first List.Clear()'s the List, then re-instantiates it, which I find odd.  Why .Clear() if you're going to re-instantiate it? 


    void ClearSelected()
    {
        TheValues.Clear();
        TheValues = new List<int>(TheValues);
    }

1) Is it supposed to work with .Clear() and then add new items after the first time?

2) Why does it work the first time with adding new items?

3) Am I doing something incorrectly?

4) Why does the example .Clear() and then re-instantiate it? 

Thanks!

Dimo
Telerik team
 answered on 24 Feb 2022
1 answer
878 views
Hello,
I'm currently using the TelerikGrid component from Telerik UI for blazor, and I would like to know if there's a possibility of retrieving the currently displayed data on a page. 
For example if I got 24 data and set the PageSize to 18, is there a way to get a list of the 18 data displayed on the first page and when going to second page, get a list of the 6 data on this page ?

Thanks in advance 

Rémy Macherel
Marin Bratanov
Telerik team
 answered on 23 Feb 2022
0 answers
138 views

Hi all,

I am using TelerikTreeList with custom filter menu. In the filter menu template I am using TelerikRadioGroup with Vertical layout but it is always display as Horizontal. I try to add css to a div outside with display:inline but it still does not work. It is only display as Vertical when I inspect element and then remove class k-filter-menu.

The problem is I have many items in the radioGroup so display Horizontal does not look good. Is there any workaround solution for this?

 

The code is look like this (I already removed some other columns)


    <TelerikTreeList Data="@Tasks"
                     IdField="Id"
                     Class="taskTreeView"
                     ParentIdField="ParentId"
                     Resizable="true"
                     EditMode="TreeListEditMode.Inline"
                     FilterMode="@TreeListFilterMode.FilterMenu"
                     OnRowRender="@OnRowRenderHandler">
        <TreeListToolBar>
            <TreeListCommandButton Command="Add" Icon="add">New Task</TreeListCommandButton>
        </TreeListToolBar>

        <TreeListColumns>
            
            <TreeListColumn Field=@nameof(TaskItem.DueDate) Title="Due Date" Width="100px" FieldType="@typeof(string)">
                <Template>
                    @{
                        var item = context as TaskItem;
                        <div>
                            @(item.DueDate.ToString("MMM d"))
                        </div>
                    }
                </Template>

                <FilterMenuTemplate>
                    @{
                        HireDateFilterMenuTemplateContext = context;
                        ExtendHireDateFilterDescriptor();
                    }

                    <div class="filter-radio">
                        <TelerikRadioGroup Data="@DateOptions"
                                           Value="@SelectedDueDateRadioSelector"
                                           ValueChanged="@((int value) =>
                                                     OnChangeHandler(value) )"
                                           Layout="RadioGroupLayout.Vertical"
                                           ValueField="@nameof(RadioOptionsModel.IdField)"
                                           TextField="@nameof(RadioOptionsModel.DisplayField)">
                        </TelerikRadioGroup>
                    </div>
                </FilterMenuTemplate>
            </TreeListColumn>
    </TelerikTreeList>

 

The UI looks like this

 

Tuan
Top achievements
Rank 1
 updated question on 23 Feb 2022
1 answer
170 views

REPL

How to avoid this?

Nadezhda Tacheva
Telerik team
 answered on 23 Feb 2022
1 answer
320 views

Hi,

I need to make a responsive layout with a splitter.

If I remove a SplitterPane with Telerik MediaQuery it renders in a different order, same as this question:

https://feedback.telerik.com/blazor/1509284-splitter-order-changed-after-hiding-and-showing-pane?_ga=2.220935836.529993596.1645460989-111903490.1447636048

I cannot recreate the whole layout, because one div will use leafletjs. I'm not using Telerik map because it lacks many features I need.

 

Example code:

https://blazorrepl.telerik.com/ccuQmwQF26uBicm739

 

For me the best solution would be to have something by Telerik like: https://golden-layout.com/ or https://www.htmlelements.com/blazor/blazor-ui/demos/blazor-dockinglayout?id=basic

Marin Bratanov
Telerik team
 answered on 22 Feb 2022
1 answer
512 views

Is it possible to have breadcrumbs with dropdowns?

Like this

I have a page with a list of widgets. Each widget show some data and has a detail button.

Details are displayed to the right of the list. So the dropdown will have an entry for each widget

Marin Bratanov
Telerik team
 answered on 22 Feb 2022
1 answer
443 views

Code

<TelerikNotification @ref="NotificationComponent"
HorizontalPosition="@NotificationHorizontalPosition.Center"
VerticalPosition="@NotificationVerticalPosition.Top" />

The attached photo shows how the notification gets rendered.

Please let me know how can I fix it, so that it either:

  • Comes on top of all the other items. That's fine with me, since the user can just close it.
  • Or, be limited to a certain size and let the user scroll.
Marin Bratanov
Telerik team
 answered on 21 Feb 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?