Hi,
We are using XamDataGrid and we have below style for the particular Column
<Style x:Key="DescMaxLengthKey" TargetType="Editors:XamTextEditor">
<Setter Property="ValueConstraint">
<Setter.Value>
<Editors:ValueConstraint MaxLength="40"/>
</Setter.Value>
</Setter>
</Style>
Current Problem : User is not allowed to enter more than 40 characters,if they entering only alphabets or numbers.
But they can able to enter spaces after entering 40 characters.
Could you please help us to resolve this problem.
Thanks.
After a discussion with our development team we have created a support ticket(CAS-61270-5GKH7P) and an internal issue(66509) linked to it so that you will be notified when a fix is available.
Thanks,
Diyan Dimitrov
Can you please explain more.
Do i need to use both the things : 1)TextChanged Event to handle the max length
and 2)Modifying the Templates for XamComboEditor
Unfortunately that is not going to work. XamComboEditor uses a MS ComboBox inside it, which contains a MS TextBox for text editor in its template. The MS TextBox doesn’t have value constraint settings and you have to hook to its TextChanged event and handle the max length of the text.
You should copy the templates for the XamComboEditor and modify them. You can find the default style for XamComboEditor in your installation folder i.e. “C:\Program Files (x86)\Infragistics\NetAdvantage for .NET 2009.1\WPF\DefaultStyles\Editors\ EditorsGeneric.xaml”. Hope this helps.
Hi Diyan,
Please find the attachment "XamDataGridMaxLengthInStyle.zip"
Please refer to the "Window1.xaml" file of this project.
<igEditors:ValueConstraint MaxLength = "2"/> is not working for "igEditors:XamComboEditor"
if i modify this to <Style TargetType="{x:Type igEditors:XamTextEditor}"> and remove <Setter Property ="IsEditable" Value ="True"/> then MaxLength constraint is working fine.
Please help us.
I was not able to reproduce that behavior. Can you provide a sample project where the issue is reproducing?