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

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

1 Answer 39 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 20 Mar 2013, 12:34 PM

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;
    }
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 22 Mar 2013, 02:46 PM
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.
Tags
PropertyGrid
Asked by
Randy
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or