Completed
Last Updated: 31 Jan 2024 11:39 by ADMIN
Release 2024 Q1 (2024.1.130)
David
Created on: 11 Dec 2023 13:03
Category: Buttons
Type: Bug Report
0
RadToggleSwitchElement: Exception changing the value when toggleswitchelement is added to the title bar
When I toggle it, the value changed event handler throws an exception.
1 comment
ADMIN
Nadya | Tech Support Engineer
Posted on: 11 Dec 2023 13:13

Hi, David,

You can use the following workaround:

public class MyRadToggleSwitchElement : RadToggleSwitchElement
{
    protected override void OnValueChanged()
    {
        if (this.ElementTree != null && this.ElementTree.Control != null)
        {
            Control control = this.ElementTree.Control;
            string analyticsConstant = this.Value ? Telerik.WinControls.Analytics.AnalyticsConstants.Checked : Telerik.WinControls.Analytics.AnalyticsConstants.Unchecked;
            Telerik.WinControls.Analytics.ControlTraceMonitor.TrackAtomicFeature(this, analyticsConstant, control.Name);
        }
    }
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadToggleSwitchElement);
        }
    }
}

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Attached Files: