Latest Development Blogs
Forum Topics Post
Browse By Tag
We are using Intersoft UI in combination with the DevForce entity framwork.
We are trying to find an easy to use solution for the following everyday problem:
We use UXTextBoxes to receive text input. We need an easy way to set the MaxLength property according to the maximum length of the binding entity field (from DevForce entity framework) the UXTextBox is bound to.
We have come up with two possible solutions:
1. write a value converter that receives as input the property in question and (using reflection) returns the maximum length of the text field. This converter can then be used in the binding to the MaxLength property.
2. Derive our own TextBox class from UXTextBox and set the MaxLength property automatically and dependent on the binding in the code of the class.
Both are possible solutions, but given the fact that those are everyday problems for any DB UI developer we are hoping that you have a much simpler, i.e. less verbose and labor intensive solution.
As for me I’d prefer the first option, to use a converter and bind it to the MaxLength property of UXTextBox, since this one is more feasible to be implemented.
I found an interesting discussion in here. The idea is to store the MaxLength as a property in ViewModel and then set the cell’s MaxLength property through the column’s EditingElementStyle.
If any other members who had good ideas for this topic, please feel free to leave a comment and let us hear your feedback.
Thanks for your swift response, Yudi.I implemented a value converter yesterday (using reflection to obtain the max string length attribute). It was fairly easy and it is a much more versatile solution as it can be used anywhere in xaml.Creating a max length property for every property of my entities is not a convenient solution as there can be many of them. It also raises the question how they would get updated automatically if and when the entity model gets updated and the max strings lengths change. Doing this manually is too inconvenient and error prone.Nevertheless, you said "I found an interesting discussion in here" and I'd be interested to hear other's thoughts on the issue. Could you pls specify (with a link maybe) where exactly "in here" is?
I’m sorry for I forgot to insert the link in my previous post.
Please try to check the discussion in here and here.
Discover WebUI Studio® 2012
Get Started with WebUI Studio®
WebUI Studio® Edition
For ASP.NET Development
For Silverlight Development
For WPF Development
Learn More About ClientUI