Telerik Forums
UI for Blazor Forum
1 answer
3.7K+ views

Here is my code:

01.<TelerikGrid Data="_enrollments"
02.                 AutoGenerateColumns="false"
03.                 PageSize="5"
04.                 ScrollMode="@GridScrollMode.Scrollable"
05.                 Height="400px"
06.                 RowHeight="40"
07.                 SortMode="@SortMode.Multiple"
08.                 Sortable="true">
09.        <GridColumns>
10.            <GridColumn Field="@nameof(EnrollmentDTO.Id)" />
11.        </GridColumns>
12.        <DetailTemplate>
13.            @{
14.                var category = context as EnrollmentDTO;
15.                <TelerikGrid Data="@category.Device"
16.                             Height="300px"
17.                             Pageable="true"
18.                             Sortable="true"
19.                             PageSize="5"
20.                             AutoGenerateColumns="true">
21.                </TelerikGrid>
22.            }
23.        </DetailTemplate>
24.    </TelerikGrid>

 

If I remove the DetailTemplate this works fine. Otherwise I get the following errors 

CS1662 Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type

--and--

CS0411 The type arguments for method 'TypeInference.CreateTelerikGrid_1<TItem>(RenderTreeBuilder, int, int, IEnumerable<TItem>, int, string, int, bool, int, bool, int, int, int, bool)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

I cannot figure out what is going on.


David
Top achievements
Rank 3
Iron
Iron
Veteran
 answered on 10 Dec 2020
1 answer
156 views

Please see the attached image.

I don't have any idea what caused this. I can't figure out how this could have happened. Can someone show me how to add some css to move the 'X' over a bit?

Thanks ... Ed

 

Nadezhda Tacheva
Telerik team
 answered on 09 Dec 2020
1 answer
159 views

Is there anyway to delay the showing of the toolip when showing on hover?

I want it to only show the toolip tip if I hover over an item for more than some time period (i.e. 3 seconds)

 

Kristian
Telerik team
 answered on 09 Dec 2020
1 answer
1.1K+ views

Hi everyone,

By setting the property Expanded equal to true in the collection the treeview does not expand anymore. This was working before but now, it doesn't.

To explain you more precisely what I have done: in the model I have the property Expanded. On double click on the node (not on the arrow in front of the node) I'am am setting the Expanded property to true if the node is closed or if the node is opened I'm setting the Expanded property to false. This was working before, but now it doesn't. Have you changed something for this component?

How can I fix this issue? Can you help me please?

 

Best regards,

Cipri

Marin Bratanov
Telerik team
 answered on 09 Dec 2020
1 answer
407 views
In the WASM Blazor app I'm working on, there is a centralized/global unhandled-exception handler that we leverage in order to avoid having to try/catch all over the place. For some reason, the Grid's `OnRead` event/handler seems to be swallowing exceptions, thus circumventing the aforementioned centralized handler.

Here is an example, using the bog-standard Blazor WASM template that demonstrates what I mean. Any suggestions on what to try to have exceptions that may occur in OnRead to bubble-up like everything else is? Thanks in advance.

@page "/fetchdata"
@using BlazorUnhandled.Shared
@inject HttpClient Http

    <TelerikGrid Data=@forecasts AutoGenerateColumns="true" OnRead="@GridOnRead">
        
    </TelerikGrid>
@code {
    private WeatherForecast[] forecasts;

    protected override async Task OnInitializedAsync()
    {
        // This (when uncommented) results in the expected behaviour of the Blazor error handler doing what it's supposed to
        //throw new Exception("bad thing from OnInitializedAsync");        
    }

    protected async Task GridOnRead(GridReadEventArgs args) {
        var results = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
        // This does _NOT_ result in the expected behaviour of the Blazor error handler:
        throw new Exception("bad thing from GridOnRead");
        forecasts = results;
        StateHasChanged();
    }
}

Bozhidar
Telerik team
 answered on 09 Dec 2020
1 answer
1.1K+ views

Hi,

How we can clear the list of saved files from the upload control, after have used them, without refreshing the page?

 

Thanks

Marin Bratanov
Telerik team
 answered on 09 Dec 2020
1 answer
442 views

I have a grid and I want to pop up an animation container with content specific to a row when a button is clicked in that row.

How do I reference the correct animation container?  No matter which button I click, it always loads the last animation container.

I've set @ref="notesPopup" for the animation container in the grid template

 

In code:

TelerikAnimationContainer notesPopup;

async Task ToggleNotes()
{
await notesPopup.ToggleAsync();
}

 

I think the question is how do I dynamically set the @ref and reference it in code?

 

Thank you

Nadezhda Tacheva
Telerik team
 answered on 08 Dec 2020
2 answers
688 views

I'm new to Blazor with Telerik and i'm having trouble creating a "top-level" notification layout.

I'm using a Drawer for a menu and would like a top-level notification component at the same level or above this Drawer component.

I'm using this as an example: https://github.com/telerik/blazor-ui/tree/master/notification/single-instance-per-app

But when I try to implementation something similar I end up with multiple @Body fragments in my MainLayout as seen below and in turn the content is duplicated.

Although the cascading Notification stuff works nice :)
I figure I'm missing something basic perhaps about encapsulating these into Blazor components? or something related to layouts?
Thanks,
Ed
 
<TelerikRootComponent>
    <TelerikButton OnClick="@(() => DrawerRef.ToggleAsync())" Icon="@IconName.Menu"></TelerikButton>
    <img src="https://www.qat.com/wp-content/uploads/2015/03/qat-global-logo-s.png" align="middle" />
   
    <CultureChooser />

    <TelerikNotification @ref="@Notification.Instance"
                         HorizontalPosition="@NotificationHorizontalPosition.Right"
                         VerticalPosition="@NotificationVerticalPosition.Top"
                         Class="big-notification">
    </TelerikNotification>
    <CascadingValue IsFixed="true" Value="@Notification">
        <div class="content px-4">
            @Body
        </div>
    </CascadingValue>

    <TelerikDrawer @ref="@DrawerRef" Data="@NavigablePages" Expanded="@Expanded" MiniMode="true" Mode="@DrawerMode.Push"
                   SelectedItemChanged="((DrawerItem item) => SelectedItemChangedHandler(item))"
                   ExpandedChanged="((bool newValue) => ExpandedChangedHandler(newValue))">
        <Content>
            @Body
        </Content>
    </TelerikDrawer>

</TelerikRootComponent>

Nadezhda Tacheva
Telerik team
 answered on 08 Dec 2020
1 answer
402 views
I would be nice if the Notification component would just render in the location where it was put by default.  Very strange that it doesn't.
Nadezhda Tacheva
Telerik team
 answered on 08 Dec 2020
2 answers
130 views

Is it possible to have 2 different column values show for each chart category?

1 data series would show wider than the other data series and they would be together for each vertical section?
Essentially a multi-axis column chart but merged together for matching categories.

Marin Bratanov
Telerik team
 answered on 08 Dec 2020
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?