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