Propertygrid validating


I thought I'd get close by having a keydown handler, examining the attributes of Selected Item to see if it requires a Smart Editor, but I still can't figure out where to put the Smart Editor, I tried Context Strip Menu Location, but that's miles away, there's a Tool Tip location but I can't figure out how to attach a Tool Tip to a PG cell, so it's always off the planet (i.e. Of course where I'd like to put in is at the cell location in the scrollable control on which the PG rides - but that info seems beyond reach.The problem with detecting errors in a Property Changed event is that its too late, it's after the Property gets the new value.



To specify when the editor should automatically validate its value, use the Validate On Enter Key Pressed and Validate On Text Input properties.One could put the validation code in the property set accessor but how does one communicate the error back to the code that invoked the accessor, other than by raising an exception.I hope I'm not alone in having a philosophical prejudice against using Exceptions to signal a user error.To manually force the editor's validation, call the Do Validate method.



Propertygrid validating comments


  • C# - PropertyGrid validation - Stack Overflow profil de paulette60

    paulette60

    PropertyGrid validation. This is where the value of using PropertyGrid rapidly starts to diminish. DataGridView ignores Cancel from Validating event.…