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

RadPropertGrid isn't setting the annotation "DisplayName" of properties while using PropertySetMode for showing common properties of multiple objects

1 Answer 35 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Tayyaba
Top achievements
Rank 1
Tayyaba asked on 06 Apr 2017, 11:08 AM

I am using you own example in Setting PropertSets 

In this I've set DisplayName of FillColor property, but it don't get it's this specified display name, but rather it shows the property name.

 

MainWindow.xaml

<Grid>
        <Grid.Resources>
            <local:ViewModel x:Key="vm" />
        </Grid.Resources>
        <telerik:RadPropertyGrid DataContext="{StaticResource vm}"
                        Item="{Binding Shapes}"
                        PropertySetMode="Intersection"/>
</Grid>

 

 

ViewModel.cs

public class ViewModel
    {
        public IEnumerable<object> Shapes
        {
            get
            {
                return new List<object>()
            {
                new Ellipse()
                {
                    Center = new Point(1,1),
                    FillColor = Colors.Red,
                    RadiusX1 = 4, RadiusX2 = 2
                    },
                    new RegularPolygon()
                {
                    Center = new Point(3,2),
                    FillColor = Colors.Blue,
                    CornersCount = 3,
                    SideLength = 10
                }
            };
            }
        }
    }
    public class Ellipse
    {
        [DisplayName("Fill Color")]
        public Color FillColor { get; set; }
        public double RadiusX1 { get; set; }
        public double RadiusX2 { get; set; }
        public Point Center {
            get;
            set; }
    }
    public class RegularPolygon
    {
        public int CornersCount { get; set; }
        public Color FillColor { get; set; }
        public Point Center {
            get;
            set; }
        public double SideLength { get; set; }
    }

 

Kindly suggest me it's solution.

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 06 Apr 2017, 04:52 PM
Hello,

Currently, RadPropertyGrid, when using PropertySets, has a limited support for property attributes. However, improving their support is a feature that is already on our radar. Here is the public feature request item. You can subscribe to it to get notified of our progress with its implementation.

Regards,
Ivan Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PropertyGrid
Asked by
Tayyaba
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or