This is a migrated thread and some comments may be shown as answers.

unable to set min or max property value of radslider in code behind

1 Answer 37 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 23 Jan 2014, 11:25 PM
Hi.
I have a problem setting minimum or maximum values for a RadSlider I need to generate by c# code inside a propertygrid with the help of FrameworkElementFactory.

Value binding and setting the grid column work perfectly but I am not able to set min or max slider value (and tickfrequency, too - are they readonly?).

What do I do wrong here? Or is there a better way to add properties like a radslider control inside a radpropertygrid on the fly?

Lars

Here is a code snipet:
FrameworkElementFactory slider = new FrameworkElementFactory(typeof(RadSlider));
slider.SetBinding(RadSlider.ValueProperty, new Binding(path) { Mode = BindingMode.TwoWay });
slider.SetValue(RadSlider.MinimumProperty, 0);
slider.SetValue(RadSlider.MaximumProperty, 100);
slider.SetValue(Grid.ColumnProperty, 1);

1 Answer, 1 is accepted

Sort by
0
Lars
Top achievements
Rank 1
answered on 24 Jan 2014, 08:27 AM
I was able to to the same thing by using xamlreader.

I don't know what I did wrong creating the datatemplate directly with frameworkelementfactory.

But it works now.

Lars
Tags
Slider
Asked by
Lars
Top achievements
Rank 1
Answers by
Lars
Top achievements
Rank 1
Share this question
or