Properties Grid will not show error messages / formatting with the Visual Studio 2012 Light Theme

2 posts, 1 answers
  1. Randy
    Randy avatar
    19 posts
    Member since:
    Oct 2012

    Posted 20 Mar 2013 Link to this post

    I am having trouble getting error messages / error formatting to show up when using the Visual Studio 2012 Light theme

    The code below will show an error message on the property grid with the Control Default theme but not with the Visual Studio 2012 Light Theme.

    public partial class Form1 : Form
    {
        MyObject myObject = new MyObject();
     
        public Form1()
        {
            InitializeComponent();
     
            radPropertyGrid1.SelectedObject = myObject;
        }
     
        private void radPropertyGrid1_PropertyValidating(object sender, Telerik.WinControls.UI.PropertyValidatingEventArgs e)
        {
            if (e.Item.Name == "Count")
            {
                if (int.Parse(e.NewValue.ToString()) > 5)
                {
                    (e.Item as PropertyGridItem).ErrorMessage = "Count Must Be Less Than Four";
                    e.Cancel = true;
                }
            }
        }
    }
     
    public class MyObject
    {
        public string Name { get; set; }
        public int Count { get; set; }
        public DateTime When { get; set; }
     
        public MyObject()
        {
            When = DateTime.Now;
        }
    }
  2. Answer
    Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 22 Mar 2013 Link to this post

    Hello Radndy,

    Thank you for writing.

    I was able to reproduce the issue you have described. The cause is that the theme does not have style for these elements. I have logged this issue in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - PITS Issue. 
    Until the issue is resolved you can use the attached modified version of the theme where the missing styles are included.

    I have also updated your Telerik points for bringing this issue to our attention.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Kind regards,
    Ivan Petrov
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top