Blazor ValueChange handler signature

Greetings
I'm going to handle Blazor Range Slider<int>'s ValueChange event and have not found the signature in Help yet.
Can you please let me know the signature or send me sample code?
Thanks in advance,
 Kambiz    

4 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team September 22, 2020 09:28 AM UTC

Hi Kambiz Ezzati,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with Slider component. We suspect that you are expecting the change event of Slider component. You can achieve your requirement by using onChange event of Slider component instead of ValueChange event. 
 
For your reference, we have prepared a sample with slider using OnChange event. 
 
Please, refer the below code snippet. 
 
@using Syncfusion.Blazor.Inputs 
 
<SfSlider @bind-Value="@Value" ID="dynamic_color_slider" Type="SliderType.MinRange" > 
    <SliderEvents TValue="int"  OnChange="change"></SliderEvents> 
</SfSlider> 
@code { 
    int Value = 20; 
    public void change(SliderChangeEventArgs<int> args) 
    { 
        var slider_value = args.Value; 
        System.Diagnostics.Debug.WriteLine("Change event triggered"); 
    } 
} 
 
 
Please, refer the sample from the following link. 
 
 
Please, refer the following links to know more about SF Blazor Slider component   
 
UG Documentation 
 
Demo link 
 
API reference  
  
  
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer

KE Kambiz Ezzati September 22, 2020 08:04 PM UTC

Hi Sowmia
Thanks for the update.
I just applied you change event and still not working for me.
I even opened your sample and do not see anything in output.
I added Console.WriteLine() to ensure and still nothing gets fired when I change the Slider.
I'm using your latest version Blazor 18.2.0.59 and VS 2019 Community latest version.
Warm Regards,
 Kambiz


KE Kambiz Ezzati September 22, 2020 08:27 PM UTC

I need to add that once I'm going to use Slider in DataGrid to enable end user to change and integer value in row's edit mode,
I'm having also an issue that changing Slider value in edit mode, causes slider handle to change color, I can't see any data update to my dataset (Array of object)
You can see in the snapshot that Output(MV) column cell value is not also changed when I change the slider, while they point to same property.




SP Sowmiya Padmanaban Syncfusion Team September 23, 2020 02:53 PM UTC

Hi Kambiz Ezzati, ,  
 
Query 1- I just applied you change event and still not working for me. I even opened your sample and do not see anything in output. I added Console.WriteLine() to ensure and still nothing gets fired when I change the Slider. 
 
For your reference, we have attached a video footage for previously attached sample. Refer the below link. 
 
 
Console.WriteLine() is displayed in the Visual studio output window. Refer the below screenshot 
 
 
 
Query 2- I'm having also an issue that changing Slider value in edit mode, causes slider handle to change color. 
 
We have set the Slider color based on our Bootstrap4 theme standard. If you want to change the handle color, we can change it by using below CSS styles. 
 
<style> 
    .e-control-wrapper.e-slider-container .e-slider .e-handle.e-handle-active { 
        background-color: #007bff; 
        border-color: #007bff; 
        box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007bff 
    } 
</style> 
 
Query 3- I can't see any data update to my dataset (Array of object). You can see in the snapshot that Output(MV) column cell value is not also changed when I change the slider, while they point to same property. 
  
We have analyzed the reported query by preparing a sample with DataGrid component and Slider component inside Edit Template. We are not able to reproduce the reported issue at our end. Changes gets saved properly in Grid without any error. Kindly download the sample from below   
  
Reported issue might occur when PrimaryKey property is not defined in Grid or when editor components in EditTemplate is not defined with two way binding. So we suggest you to ensure to define the IsPrimaryKey property to anyone of the column whose value is unique. Refer our UG documentation for your reference  
  
 
  
If you are still facing the issue, kindly get back to us with following details.   
  
1.     Share your Grid code example. 
2.     Share the details about your datasource (are you using any adaptor to bind data to Grid?) 
3.     Are you facing any exception in browser console. If yes share the screenshot of the error. 
4.     If possible try to reproduce the reported issue in provided sample and revert back to us. 
  
Above requested details will be helpful for us to validate the reported query at our end and provide solution as early as possible.     
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon