المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Strange Property Grid Behaviour



C# Programming
11-06-2009, 12:40 PM
I have a .NET PropertyGrid that (amongst other things) display a property with the validation rule:

[IntegerValidator(MinValue = 1, MaxValue = 5)]

If the user attempts to set it to a value outside the range then I would expect a "Properties Window" dialog with the message "Property value is not valid" and a Details button that allows the dialog to be expanded to display the message:

"The value for the property 'XXXX' is not valid. The error is: The value must be inside the range 1-5."

Occasionally though I just get an exception that is caught at the top level by my application (which then terminates).

Any ideas why this should happen? (It does seem to happen when, on leaving the cell, the user immediately scrolls the grid - but not always.)

"...there's what people want to hear, there's what people want to believe, there's everything else, THEN there's the truth!" - New York D.A., The International