Telerik Forums
UI for Blazor Forum
1 answer
419 views

I have a combobox component that can draw on available properties such as "Class" and "MaxHeight." However, when I try to implement comboboxes, I see no way to disable them. Below is a portion of the RenderComboBox method. I can only avoid the error by commenting out "d.AddAttribute(302, "Enabled", "false");"

                RenderFragment item = d =>
                {
                    d.OpenComponent<ComboBoxPopupSettings>(20);
                    if (RowCount == 0) { RowCount= 20; }
                        d.AddAttribute(300, "MaxHeight", $"{(RowCount * 22).ToString()}px");
                        d.AddAttribute(301, "Class", "telCombo");
                        d.AddAttribute(302, "Enabled", "false");
                        d.CloseComponent();
                };

The above code earns me the message

"Object of type 'Telerik.Blazor.Components.ComboBoxPopupSettings' does not have a property matching the name 'Enabled'."

Indeed, when I look it up, the list of inherited members has nothing for enabling/ disabling the feature. How can i disable it?

Radko
Telerik team
 answered on 01 Jan 2024
1 answer
870 views

Adding FormItem inside the FormItems got System.ArgumentNullException: Value cannot be null. (Parameter 'For') when rendering

This is my code of course the Model and EditContext will be different.

 

<TelerikForm Model="FarsDetailSate.Model"@
ref="FormReference"
EditContext="FarsDetailSate.EditContext"
Size="@ThemeConstants.Form.Size.Medium"
Columns="1"ColumnSpacing="40px"
Orientation="FormOrientation.Vertical"
Class="mb-3 px-3">

<FormValidation>
<FluentValidationValidatorValidator="@Validator">
</FluentValidationValidator>
<TelerikValidationSummary/>
</FormValidation>

<FormItems>
<FormItem Field="@nameof(Vehicle.MotorCarrierIdentificationNumber)" 
LabelText="Carrier: " 
Enabled="FarsDetailSate.HasEditPermission" Class="col-sm-12 col-md-6 col-lg-4">
</FormItem>
</FormItems>

<FormButtons></FormButtons>
</TelerikForm>
Radko
Telerik team
 answered on 01 Jan 2024
1 answer
527 views

Hi,

 

I have a TelerikForm containing a Fluent Validator and 2 buttons.
Only one of them has to validate the form.

However, even if I set NO  code into the button's associated method, it does trigger the validation.

Seems to be a default behaviour.

How to disable it for my second button?

 

Thx in advance

 

A

Radko
Telerik team
 answered on 25 Dec 2023
1 answer
255 views

Hi there!

I have created a component (Component) that is a TileLayoutItem. It renders fine for the first time but it doesn't re-render after its properties changes (OnClickHandler).

Am I doing something wrong? The exact same code works if added directly on Main.

Running example: https://blazorrepl.telerik.com/mnbQmvlX24maslQE52

Component

<TileLayoutItem>
    <HeaderTemplate>
        <a href="#">Component<span class="k-icon k-i-caret-alt-right widget-title-icon"></span></a>
    </HeaderTemplate>
    <Content>
        @test
        <TelerikButton OnClick="@OnClickHandler">Click me!</TelerikButton>        
    </Content>
</TileLayoutItem>
@code {
    private string test = "Button was not clicked yet";
    private void OnClickHandler(MouseEventArgs args)
    {
        test = "Button was clicked at: " + DateTime.Now.ToString();            
    }
}

Main

<TelerikTileLayout Columns="1">
    <TileLayoutItems>
        <Component></Component>
        <Component></Component>
        <TileLayoutItem>
            <HeaderTemplate>
                <a href="#">TileLayoutItem<span class="k-icon k-i-caret-alt-right widget-title-icon"></span></a>
            </HeaderTemplate>
            <Content>
                @test
                <TelerikButton OnClick="@OnClickHandler">Click me!</TelerikButton>        
            </Content>
        </TileLayoutItem>
    </TileLayoutItems>
</TelerikTileLayout>
@code {
    private string test = "Button was not clicked yet";

    private void OnClickHandler(MouseEventArgs args)
    {
        test = "Button was clicked at: " + DateTime.Now.ToString();            
    }
}

Radko
Telerik team
 answered on 25 Dec 2023
1 answer
978 views

Here is the problem:

When the page first loads, the grid attempts to load the layout defined on the page. This causes a OnRead event to occur as is expected. However, the OnStateInit does NOT fire before this OnRead event. Actually, this is not entirely correct. The initial OnRead is running independent of the OnStateInit, it simply fires and it returns when it feels like it. At some point the OnStateInit fires. I load a saved GridState layout in the OnStateInit event which causes the OnRead to fire again. 

This causes a couple problems. The grid will load, and then reload as the args.GridState is set in OnStateInit. This causes ugly page flashing, and two data requests when only one is required. Even worse since both requests are async, you are not sure which layout you will get, since the last one to come back is the one you get, which can and does occur randomly.

I can return no data for the initial request in OnRead, and this does work, however I can find no reliable way inside of the OnRead event to determine which is the initial load I don't want and which is the OnRead fired from the args.GridState set in OnStateInit which I do want.

My question is, how do I prevent the initial grid data request and load?

Bryan

Radko
Telerik team
 answered on 25 Dec 2023
0 answers
140 views
after creating account and validating email i wasn't returned back to visual studio. do i just close VS and start again?
Paul
Top achievements
Rank 1
 asked on 24 Dec 2023
1 answer
174 views

Hi

When we plot an area series on the same chart as a line series we find that the area series no longer fills the full width of the chart, as shown below.  Here is a REPL with the code to reproduce it.

Is there a way to restore the behaviour of the area series, like this?

Thank you

Mark

Hristian Stefanov
Telerik team
 answered on 22 Dec 2023
1 answer
162 views

Is it possible to disable the movement to the next row when a user uses the enter key to edit a field with in-cell editing?

I looked through the forums but only found an old thread regarding a WinForms property for an EnterKeyMode. This would be a great addition to the Blazor controls.

Hristian Stefanov
Telerik team
 answered on 22 Dec 2023
1 answer
216 views
We are start using Blazor in a major redevelopment of our Angular App.
We are looking at the Drawer to create a side navigation component that will display Hierarchical data.
At the moment with just two levels the description of the items is clipped and shows the three dots at the end e.g. "Financial Comparis..."
How do I resize the drawer sidebar width to more than the default 240px so that text is not clipped and ends with ....?
Hristian Stefanov
Telerik team
 answered on 20 Dec 2023
1 answer
350 views

I have recently downloaded the latest Telerik.UI for blazor 5.0.1 commercial and I tried converting a dotnet 8 project to a telerik project using the context menu. 

Is there a plan to have support for the new .NET 8 project templates?

The option to also create a new blazor project from the Visual Studio 2022 project templates is gone. I cannot create a blazor project.

I saw the "Discover the Magic of .NET 8 and Beyond!" webinar and it seemed support for .NET 8 was ready

Momchil
Telerik team
 answered on 20 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?