Unplanned
Last Updated: 27 Nov 2025 11:27 by ADMIN
Leonard
Created on: 25 Nov 2025 15:19
Category: CheckBox
Type: Feature Request
0
CheckBox: Provide an option to cancel the change event
For example IsCheckedChanging event with e.Cancel
1 comment
ADMIN
Didi
Posted on: 27 Nov 2025 11:27

Solution until the feature is implemented: use the IsCheckedChanged event and set the value of the RadCheckBox.IsChecked property based on a condition. Here is an example:

public partial class MainPage : ContentPage
{
	ViewModel vm;

	public bool OperationPassed = true;
	public MainPage()
	{
		InitializeComponent();
		this.vm = new ViewModel();
		this.BindingContext = this.vm;
	}

	private void RadCheckBox_IsCheckedChanged(object sender, IsCheckedChangedEventArgs e)
	{
		if (this.OperationPassed is false)
		{
			this.vm.MyProperty = false;
		}

		else this.vm.MyProperty = true;
	}
}

public class ViewModel : NotifyPropertyChangedBase
{
	private bool myproperty = false;
	public bool MyProperty
	{
		get
		{
			return this.myproperty;
		}
		set
		{
			if (this.myproperty != value)
			{
				this.myproperty = value;
				OnPropertyChanged();
			}
		}
	}
}

and the xaml:

<HorizontalStackLayout Spacing="5" VerticalOptions="Start">

		<telerik:RadCheckBox IsChecked="{Binding MyProperty, Mode=TwoWay}" 
                             IsCheckedChanged="RadCheckBox_IsCheckedChanged" 
                             IsThreeState="False"/>
	</HorizontalStackLayout>

Regards,
Didi
Progress Telerik