Slider not usable?!

Tested and works like a charm :slight_smile:

Hello Radzen Team,
there is something wrong with the "Change" event of the Slider Component.

Video

Tested with Radzen.Blazor 2.15.16 & 2.15.17

Kind Regards
Thomas

TValue="int" is missing. Most probably Visual Studio locks the .razor file and Radzen cannot save the newly generated code.

Hi @enchev,
im working always with VS on and never had a problem with locked generated files.
I tested it without VS running. Same behaviour.

Video

Greets
Thomas

Here is what is generated for me with change event added:

It seems it has to do with the binding....

Thomas

You should not use Change event with binding.

For what then is the cange event? :flushed:
I want to show a circle on a google map where the user can set the radius by a Slider.
How can i achieve this without using binding and the change event?


Thomas

Since you have binding the bound property will be updated on every change. You can use the value of the property bound to Silder Value. Change event was added back in the beginning of our Blazor support and allowed our form components to be used before @bind-Value. Our components can be used also without form - unlike default Blazor components. You can either use binding (@bind-Value) or Change event.

Im not a Web Developer or someone who knows much about Blazor/Razor and so on.
but i cant see any use case for a change event without binding.
What can someone do in a change event without the value which has changed?

When i understad that right i must now define a property "radius" and in set-method i can do something with the radius value. Is that right?

Greets
Thomas

@Thomas,

Radzen is a low-code tool, not no-code and you need to understand the framework and technologies used by Radzen. Yes, binding will update the value of a property on every change - you do not need any events. More info can be found here:

Hi @enchev,
i see i need some more understanding of Blazor/Razor and binding.
Thanks for the link i have a look at it :+1:t3:

Thomas

Hi @enchev,
is it the same for the selectbar component change event or is it a bug that there are compile errors when using binding and change event?

radzen: Generating code ...
radzen: Code generation done in 228ms.
dotnet: watch :
dotnet: Started
dotnet: obj\Debug\netcoreapp3.1\Razor\Pages\AddA1.razor.g.cs(173,125): error CS1503: Argument "6": Konvertierung von "Microsoft.AspNetCore.Components.EventCallback" in "Microsoft.AspNetCore.Components.EventCallback" nicht m�glich. [C:\Users\Thomas\source\repos\Radzentest\server\RadzenTest.csproj]
dotnet:
dotnet: Fehler beim Buildvorgang. Beheben Sie die Buildfehler, und versuchen Sie es anschlie�end noch mal.
dotnet: watch : Exited with error code 1
dotnet: watch : Waiting for a file to change before restarting dotnet...

Thomas

after all... you said "Do not use Change event with binding". :wink:

Thomas

Yes, it's the same for all form components - check our demos to get the list of form components.

Hi @enchev,
the change event for some form components like checkboxes, numeric, textboxes and so on works fine.
Now i am completly irritated... you say

Yes, it's the same for all form components - check our demos to get the list of form components.

You should not use Change event with binding.

You can either use binding (@bind-Value) or Change event.

as i see and test it... some form components work with binding and change event and some not.

I use these database/model bound form components with change events.

                        <RadzenCheckBox TriState="false" @bind-Value="@(partner.Rechnungspartner)" TValue="bool?" Name="Rechnungspartner" Change="@RechnungspartnerChange">
                        </RadzenCheckBox>

Should i change this? Is it the wrong way and maybe didnt work in the future?

Sorry for annoying you but am irritated about the way i must go to build a good coded app. :confounded:

Thomas

1 Like

The next Radzen release will support handling the Change event of the Slider and Selectbar.

I am locking this thread as it diverged from the original topic.