Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

custom UITypeEditor with modal dialog

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
jkempner



Joined: 03 Sep 2008
Posts: 17

PostPosted: Tue Oct 30, 2012 10:57 am    Post subject: custom UITypeEditor with modal dialog Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Oct 30, 2012 9:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group