We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Label

Hello,

I am using the radial slider control, and I was wondering if there is a simple solution to a problem I'm having. When I try to use labels to indicate the values of each "tick" on the slider, it also displays the current value of the slider. This would be fine, IF there were different radii for the displays. Values that are close to the value of a tick make the two values overlap and look ugly. I have added a text box that binds the value in the center of the slider, but I would still like to show the values of the tick labels. Is there a way to remove the "current value" binding of the pointer/label and keep the tick labels? I want the current value of the slider to display in the center only.

Thanks so much!!

1 Reply

VJ Victory Jessie Selvam D Syncfusion Team January 6, 2017 07:15 AM UTC

Hi Eric,

Thank you for using Syncfusion products.

We have prepared a sample to collapse the current value label in SfRadialSlider control. In the sample, we have retrieved the RadialList which displays current value by traversing visual tree and collpsed it. You can download the sample from the following link:

Sample: RadialSlider_Collapse_ValueLabel

Code Example
:

private void radialSlider_Loaded(object sender, RoutedEventArgs e) 
        { 
            radialSlider.Loaded -= radialSlider_Loaded; 
            RadialList valuelabel = Utils.GetChild<RadialList>(radialSlider, "PART_LabelsRunTime"); // Retrieving the value label 
            RadialList valuetick = Utils.GetChild<RadialList>(radialSlider, "PART_TicksRunTime"); // Retrieving the Value tick 
            if (valuelabel != null) 
                valuelabel.Visibility = Visibility.Collapsed; 
            if (valuetick != null) 
                valuetick.Visibility = Visibility.Collapsed; 
        }

public class Utils
 
    { 
        public static T GetChild<T>(DependencyObject parent, string name) where T : DependencyObject 
        { 
            if (parent == null)  
                return null; 
            T foundChild = null; 
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) 
            { 
                var child = VisualTreeHelper.GetChild(parent, i); 
                T childType = child as T; 
                if (childType == null) 
                { 
                    foundChild = GetChild<T>(child, name);  
                    if (foundChild != null)  
                        break; 
                } 
                else if (!string.IsNullOrEmpty(name)) 
                { 
                    var frameworkElement = child as FrameworkElement; 
                    if (frameworkElement != null && frameworkElement.Name == name) 
                    { 
                        foundChild = (T)child; 
                        break; 
                    } 
                } 
                else 
                { 
                    foundChild = (T)child; 
                    break; 
                } 
            } 
            return foundChild; 
        } 
    } 
 

Regards,
Jessie

Loader.
Up arrow icon