I want to create a usercontrol that will store doubles.
I have got the basics down so far, i.e. implementing IDataType, inheriting BaseDataType, creating a control that implements IDataEditor and a "DataDouble" that inherits from DefaultData..
So now I want to ensure the page isnt published if the value is invalid.
I have tried putting a ValidationProperty on my IDataEditor implementation, but its never called.
I also tried it on my IDataType implementaion.. still nothing.
I really dont want to have to specify the validation regex on each use of the control.
Since the control is specific to doubles, id like to maybe specify the regex in the code, perhaps as an override or hardcoding a property to set the value.
Creating an Umbraco Data Type
I want to create a usercontrol that will store doubles.
I have got the basics down so far, i.e. implementing IDataType, inheriting BaseDataType, creating a control that implements IDataEditor and a "DataDouble" that inherits from DefaultData..
So now I want to ensure the page isnt published if the value is invalid.
I have tried putting a ValidationProperty on my IDataEditor implementation, but its never called.
I also tried it on my IDataType implementaion.. still nothing.
I really dont want to have to specify the validation regex on each use of the control.
Since the control is specific to doubles, id like to maybe specify the regex in the code, perhaps as an override or hardcoding a property to set the value.
Has anyone tried this??
Okay.. seems ValidationProperty works when put on the IDataEditor implementation.
BUT.. only when the field is mandatory. which is wierd..
Can I make the editor mandatory from code??
is working on a reply...