View previous topic :: View next topic |
Author |
Message |
jkempner
Joined: 03 Sep 2008 Posts: 17
|
Posted: Tue Oct 30, 2012 10:57 am Post subject: custom UITypeEditor with modal dialog |
|
|
I've implemented a custom editor along the lines described in this thread, but I want the text displayed in the cell to be read-only. That is, the universal edit box gives me the "..." button but also allows the text to be edited directly, and the editable text can allow the user to enter invalid data. Is there an easy way to make that text read-only, or will I need to validate the text after it's edited? The results returned by the modal dialog are already validated by the dialog itself. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Oct 30, 2012 9:53 pm Post subject: |
|
|
Normally the UniversalEditBox uses the TypeConverter associated with the edited value to convert any entered text to the value type. If this fails (throws an exception) then it displays an error message (defined by the TextErrorMessage property). If you want to prevent user input altogether then you would need to derive a new control from UniversalEditBox (eg ReadOnlyUniversalEditBox) and in the constructor set the ReadOnly property of the internal TextBox to true.
eg
Code: | public ReadOnlyUniversalEditBox()
{
this.TextBox.ReadOnly = true
} |
_________________ Infralution Support |
|
Back to top |
|
|
|