How can I pass the context of a TreeView's ItemTemplate to a click handler? This is what I have:
<
TelerikTreeView
Data
=
"@TreeData"
>
<
TreeViewBindings
>
<
TreeViewBinding
IdField
=
"Id"
TextField
=
"Text"
>
<
ItemTemplate
>
@{
<
TelerikButton
OnClick
=
"@OnClickHandler"
>@((context as TreeItem).Text)</
TelerikButton
>
}
</
ItemTemplate
>
</
TreeViewBinding
>
</
TreeViewBindings
>
</
TelerikTreeView
>
@code {
public class TreeItem
{
public string Id { get; set; } = $"{Guid.NewGuid()}";
public string Text { get; set; }
public ObservableCollection<
TreeItem
> Items { get; set; } = new ObservableCollection<
TreeItem
>();
public bool Expanded { get; set; }
public bool HasChildren { get; set; }
public bool Selected { get; set; }
}
private void OnClickHandler(TreeItem context)
{
}
Hey all,
I have a Blazor chart which has about four series on it and each series has a hundred or so points. If I turn on the series labels, they all turn on and it makes my chart unreadable. Is there a way to have them only appear when you either mouse over a marker on the series or when you click on the marker in the series? This sounds easy to do but I can't seem to manage it with the Blazor chart. Any and all help will be appreciated. Thanks.
Cheers,
Jimmy
Hi,
I am getting the following exception from the grid and cannot understand why. The collection supplied to the function is definitely not empty and my function exits without a throw. Is there a way to understand why the code inside the grid is throwing an error? Then the circuit crashes and the blazor application is now dead.
If I use a GridCommandColumn no errors are raised.
Unhandled exception rendering component: Index was
out
of range. Must be non-negative and less than the size of the collection. (Parameter
'index'
)<br>System.ArgumentOutOfRangeException: Index was
out
of range. Must be non-negative and less than the size of the collection. (Parameter
'index'
)<br> at System.Collections.Generic.List`1.get_Item(Int32 index)<br> at Telerik.Blazor.Components.Grid.GridDataCellBase`1.get_Column()<br> at Telerik.Blazor.Components.Grid.GridContentCell`1.get_BoundColumn()<br> at Telerik.Blazor.Components.Grid.GridContentCell`1.OnClick()<br> at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)<br> at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)<br>fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]<br> Unhandled exception
in
circuit
'-1BdfTDXKpRyAHNMXnaoanw8GipVDkrJ6NXuvg48GmA'
.<br>System.ArgumentOutOfRangeException: Index was
out
of range. Must be non-negative and less than the size of the collection. (Parameter
'index'
)<br> at System.Collections.Generic.List`1.get_Item(Int32 index)<br> at Telerik.Blazor.Components.Grid.GridDataCellBase`1.get_Column()<br> at Telerik.Blazor.Components.Grid.GridContentCell`1.get_BoundColumn()<br> at Telerik.Blazor.Components.Grid.GridContentCell`1.OnClick()<br> at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)<br> at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
According to this Link, CRUD functionality for the TreeView control is available starting with version 2.7.0. Do you have a working example you could share?
Link
The Blarzo UI Is getting better.
I just put forward something missing:
1>The Chart UI need:
tooltip/datapoint label/Crosshair,Maybe I didn't see an example( except the Pie Chart)
2>The DatePicker/DateTimePicker/NumericTextbox need:
Modify data with mouse wheel
3>The DatePicker/DateTimePicker's droplist need:
MouseOver effect.
4>In the future,Step by step realized these function Similar to the Aspnet core UI.
Hello,
Is it possible to use the UI for Blazor within a Razor class library?
We have a project where we need to have multiple reusable component libraries that will ideally be based on UI for Blazor, in our current tests we add the nuget package to the Razor class library and it fails to be recognised when trying to consume the namespaces. Also we need to share the App between Server and Client Blazor, once again requiring the UI for Blazor to be with a shared razor library.
Thanks,
Andy.
Hi,
I am trying to run a blazor server side component inside a razor view page.
So the razor view is this:
<
div
class
=
"wrapper"
>
@await Html.PartialAsync("_farmMenu", new PfmsWeb.Areas.Shared.ActiveMenu("PickupSequence"))
<
div
id
=
"main"
class
=
"sidebar-page main"
>
<
component
type
=
"@typeof(PfmsWeb.Components.Harvest.PickupSequence.PickupSequenceShell)"
render-mode
=
"ServerPrerendered"
/>
</
div
>
</
div
>
And the PickupSequenceShell.razor file looks like this:
<
TelerikRootComponent
>
Shell Started
<
br
/>
<
Counter
/>
</
TelerikRootComponent
>
However, when running the application the counter is not rendered at all. If I reference the counter directly from the razor view it does work. There must something in my understanding that is stopping this from working properly. It cannot be the blazor js as like I said I can run the counter directly from the razor view.
This is a very large application so I cannot easily just bring the entire thing into blazor server side, I have to host little blazor server side apps inside the razor views refactoring parts of the application as I go.
Has anyone managed to get a hybrid app working on dotnet core with controllers and views?