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

2 posts, 0 answers
  1. Tayyaba
    Tayyaba avatar
    12 posts
    Member since:
    Apr 2017

    Posted 06 Apr Link to this post

    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.

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1201 posts

    Posted 06 Apr Link to this post

    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.
Back to Top