Telerik Forums
UI for Blazor Forum
1 answer
157 views

I'm using Telerik.UI.for.Blazor 3.0.0 and pasting the following HTML does not lead to the expected result.

<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>

Result (Preview):

<ul>

<li>A</li>

<li>B</li>

<li>C</li>

</ul>

Result (Raw view):

<p>&lt;ul&gt;</p><p>&lt;li&gt;A&lt;/li&gt;</p><p>&lt;li&gt;B&lt;/li&gt;</p><p>&lt;li&gt;C&lt;/li&gt;</p><p>&lt;/ul&gt;</p>


 

Expected Result:

  • A
  • B
  • C

 

Using Telerik UI for jQuery it was sufficient to set the following setting to get the expected result.

$scope.kendoEditorOptions = {
    pasteCleanup: {
        keepNewLines: true, // Removes all HTML elements, such as the all option, but preserves new lines. Disabled by default.
    }
}

 

I've tried out all different settings that the Blazor version offers using the demo from https://demos.telerik.com/blazor-ui/editor/paste-cleanup?_ga=2.205591514.897269513.1644322509-2087119569.1643891453, but without success.

 

For a workaround I've implemented the ValueChanged EventCallback to convert from

<p>&lt;ul&gt;</p>

to

<ul>

on-the-fly, but since each line of the pasted content is wrapped around with with <p>...</p> this is not optimal.

 

Is there a way to achieve the expected result? It would already help if the automatic wrapping with <p>...</p> tags could be turned off. Otherwise I'm leaning towards switching back to the jQuery version.


Thanks and BR!

Nadezhda Tacheva
Telerik team
 answered on 15 Feb 2022
2 answers
1.7K+ views

Hello,

I am wanting to use a TelerikButton outside of my TelerikGrid to get the current selected row in the Grid, I do not want to use a GridRowButton on each row, but one TelerikButton outside of the grid.

For an example, we have a Grid of employees and each employee is an object in a list of EmployeeVM class objects. which has an EmployeeID for each employee. When the TelerikButton is clicked, I want to get the EmployeeID of the employee selected in the Grid in a method in the @code section that is the same as listed in the OnClick property on the Telerik Button.

I spent some time searching on Google but did not find what I was looking for, I am an experienced developer but new to Telerik UI for Blazor.

Thank you.

 

Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 answered on 15 Feb 2022
0 answers
724 views

As of 3.01, the ExpandedField property of TreeViewBinding no longer exists and we're meant to bind the ExpandedItems property of the tree view instead. However, this is fine for a flat data source but doesn't really work for a hierarchical data source.

I'm loading my hierarchical data source to include all expanded nodes and child nodes so that I can reselect the previously selected node, and this can go down 5 levels or more. So how can I create an expanded items local variable to bind to tree view control from that?

The ExpandedField approach worked fine in this scenario, but I don't see how the ExpandedItems approach can. The only way I can see to resolve is to change my hierarchical data source to be flat which would be a lot of work and wouldn't really be ideal.

On another matter, the class applied to the selected tree node span element seems to have changed from k-state-selected to k-selected, although I don't see this documented anywhere.

Any advice on how I can get round the expanded items problem without drastically rewriting my code would be appreciated.

Brian
Top achievements
Rank 1
Iron
 asked on 14 Feb 2022
0 answers
252 views

I'm currently trying to use AuthorizeView to inherit the Policy restrictions to programmatically show/hide the GridCommandButton

Something like this:

<AuthorizeView Policy="@Policies.ManageAllUsersPolicy">
            <Authorized>
                <GridCommandColumn Width="190px">
                    <GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
                </GridCommandColumn>
            </Authorized>
 </AuthorizeView>

But I get an Error:

 

SeverityError
CodeRZ9999
DescriptionThe child content element 'ChildContent' of component 'GridCommandColumn' uses the same parameter name ('context') as enclosing child content element 'Authorized' of component 'AuthorizeView'. Specify the parameter name like: '<ChildContent Context="another_name"> to resolve the ambiguity

 

I'm fairly new to the Kendo UI so I simply tried to name the Context directly on the AuthorizeView/Authorized component and GridCommandColumn (there's no Context property on GridCommanButton)
But without success.

Is it possible to use AUthorizeView, or should I move toward a solution where I manually check to the fulfillment of the policy and use a boolean to show/hide the button?

Fabrizio
Top achievements
Rank 1
 updated question on 14 Feb 2022
2 answers
728 views

The dialog doesn't seem to be properly initialized in this scenario.

REPL: Example

Haiqiang
Top achievements
Rank 1
Iron
 updated answer on 14 Feb 2022
1 answer
152 views

Am I correct that it is currently not possible to have a form field that is both formatted as currency and has a hint text? In order to format as anything, it seems we need to use templates, and if we do, the stuff like HintText, Labeltext etc also goes missing? 

Having to always use templates for most basic stuff in grids, forms etc. like getting a bool to show up as a checkbox or a simple int to be displayed as currency, is really starting to get to me to be honest...

Dimo
Telerik team
 answered on 13 Feb 2022
2 answers
3.4K+ views
I test your three demo by on line:   ASP NET Core Demo
                                                        Blazor server demo
                                                        Blazor WebAssembly demo(blazor-stocks)
The ASP NET Core Demo response is OK,
but the click response often lost with the Blazor server demo,the action response is very slow!
blazor-stocks demo load is very slow,when load complete,the action response is quickly.
 I think about the Blazor UI is dependent on the network speed very much!
Jonathan
Top achievements
Rank 1
Iron
Iron
 answered on 12 Feb 2022
0 answers
130 views

*** UPDATE If I remove the set culture code, then it works **

Adding Format="{0:d}" to this code Telerik REPL for Blazor - The best place to play, experiment, share & learn using Blazor.

works fine.

If I try to do the same I get this:

First Format="{0}"

Using Format="{0:d}" I get this. Same when I use any other formats like Format="{0:yyyy.MM.dd}"

When not using any kind of format. Not good enough. Missing the year

 


 <TelerikChart RenderAs="RenderingMode.Canvas">
            <ChartTitle Text="Prices"/>
            <ChartTooltip Visible="true"/>
            <ChartLegend Position="ChartLegendPosition.Bottom"/>

            <ChartSeriesItems>
                <ChartSeries Type="ChartSeriesType.Line"
                             Name=""
                             Data="@Details.PriceGraphs"
                             DashType="@DashType.Solid"
                             CategoryField="@nameof(InstrumentPriceGraph.UpdateDate)"
                             Field="@nameof(InstrumentPriceGraph.Price)">
                </ChartSeries>
            </ChartSeriesItems>

            <ChartValueAxes>
                <ChartValueAxis Min="@_yMinValue" Max="@_yMaxValue"/>
            </ChartValueAxes>

            <ChartCategoryAxes>
                <ChartCategoryAxis Type="ChartCategoryAxisType.Date" BaseUnit="ChartCategoryAxisBaseUnit.Days">
                    <ChartCategoryAxisLabels Step="2" Format="{0:d}">
                        <ChartCategoryAxisLabelsRotation Angle="-45"/>
                    </ChartCategoryAxisLabels>
                </ChartCategoryAxis>
            </ChartCategoryAxes>

        </TelerikChart>
Setting the culture in Blazor wasm Program.cs

var culture = new CultureInfo("da-DK");
culture.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy";
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 11 Feb 2022
1 answer
442 views

1. I am creating a pie chart and the element the chart is nested in has a white background I cant seem to change please help.

2. I am using custom styling and have left out a component I would like to add  a single component. I have however changed some of the default telerik styling in the file is there a way I can get the exclusive css for a single component without needing a whole new file?

thanks

 

Marin Bratanov
Telerik team
 answered on 10 Feb 2022
1 answer
1.2K+ views

https://docs.telerik.com/blazor-ui/components/stepper/events

According to the docs, it says the OnChange event fires before the current step has changed. I'm assuming clicking the Stepper itself triggers this event, but what if I wanted to go to the next step by clicking on a custom button that I've created? This seems like a common use case, is this possible with the stepper?

I don't want to use the Wizard component because it doesn't seem possible to customize it to match my requirement: I want to keep all previous steps' content rendered on the page vertically as you progress through the wizard instead of having the each step content replaced by the next step content. The documentation doesn't seem to allow for customization of the step content rendering behaviour but please correct me if I'm wrong (https://docs.telerik.com/blazor-ui/components/wizard/structure/content).

Marin Bratanov
Telerik team
 answered on 10 Feb 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?