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.
Unfortunately, activation email could not send to your email. Please try again.

Label

Thread ID:

Created:

Updated:

Platform:

Replies:

128170 Jan 5,2017 04:38 PM Jan 6,2017 02:15 AM WPF 1
loading
Tags: SfRadialSlider
Eric Baumann
Asked On January 5, 2017 04:38 PM

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!!

Victory Jessie Selvam D [Syncfusion]
Replied On January 6, 2017 02:15 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;