Hello,
I'm trying to implement the validation on some of my Xamgrid fields, I am using the INotifyDataErrorInfo on the objects that needs to be validated.
When I use a XamMaskedInput as the editor for my data (a simpel string) the Validation Tooltip is correctly shown :
But I do not need a XammaskedInput in this field, so I decided to pu a simple XamtextEditor and the tooltip doesn't show up anymore (but the border of the control remains red) :
How can I manage to get the same bahavior than the XamMaskedInput ??
Thanks
Hello PEO-Stokomani,
Thank you for your post!
The XamMaskedInput and the XamTextEditor do not have the same error validation behavior by default, as they are from two different families of controls - Shared Inputs and WPF Specific Editors. Being that you are using the XamGrid, I would recommend that you continue with the XamMaskedInput, as it is essentially the text editor of the Shared Inputs family of controls. The difficulty that you may face here is that the XamGrid is a Shared control, which means it has shared functionality between WPF and Silverlight, but the XamTextEditor is a WPF specific control. If you are looking to have your XamGrid work in Silverlight as well as WPF, you will not be able to use the XamTextEditor in this way. It is for this reason, and the reason that the inputs were meant for the XamGrid, whereas the editors were meant for the XamDataGrid, that I would recommend continuing with the XamMaskedInput in your XamGrid.
If, however the above is not an option for you, I would recommend going into the default style for the XamGrid, which is commonly found here: C:\Program Files (x86)\Infragistics\2015.1\WPF\DefaultStyles\XamGrid\generic.shared.xaml. In that XAML file, you will find a ControlTemplate that targets ToolTip. The x:Key of this ControlTemplate is "CommonValidationToolTipTemplate." This is what you will need to apply to your XamTextEditor.ToolTip property to get the red validation tooltip in the XamGrid.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi,
If it is better to use the XamMaskedInput I will use it, but home can I manage to make it work liek XamtexEditor?
I mean : No "____" characters inside the input, no possibility to type letters wherever the user wants (like with masks and the "___" prompt...).
Besides, When I put a XamMaskedInput, with no constraints, (I mean the simplest XAML declaration that could exists : <ig:XamMaskedInput />) it is limited to 65 characters (no more can be typed in teh input over 65 !). So it is problematic because the Maximum length that must be accepted is 70 for my case !
Thanks in advance.
Hi I have put the XamMaskedInput, with the PromptChar set to an empty string I am able to type some text like a simple TextBox.
Thus, the length is still locked to 65 characters in the input, in spite of the configuration that does not declare any restroctions :
<ig:XamMaskedInput Text="{Binding ShortLabel.Value,Mode=TwoWay}" PromptChar=""/>
I Have tried to put a XamMaskedInput in a sample project and it appears to be really blocked a 65 characters.
If there is no workaround possible I will fall back to the XamTextEditor with a style for tooltip copied from infragistics default's styles.
Regards
I have been looking further into this, and I have reproduced this behavior you are referring to. After a bit more research though, I'm not entirely sure why you are changing the editor of a particular column in the XamGrid to a XamMaskedInput if you are looking to have a text column in the XamGrid. It appears that I was mistaken in my claim in my original response that the XamMaskedInput works as the text editor of the shared inputs family of controls. It actually appears that this is not correct, and the XamGrid uses a simple text box to edit the columns that have a string type. The tooltip that I had directed you to also belongs to the default template of the XamGrid, and so if something goes wrong in your class that is implementing INotifyDataErrorInfo, you should still see this tooltip that you are looking for, without the need to change the editor. I found another forum thread that explains this in further detail as well, and I believe it may help you on this matter: http://ko.infragistics.com/community/forums/t/59834.aspx.
Is there any particular reason you were looking to change the editor type on the XamGrid column in this case?
In fact, I need special behaviors and/or command bindings in many of my text columns.
So the templateColumn is perfect for that, and with a XamMaskedInput or a XamtextEditor I can do whatever I want.
Is is not a simple string value in edit/display mode.
But I will perhaps put a Simpel TextBox because XamtextEditor doesn't seem to provide and "Upeprcase" property in order to force uppercase.
;-)
While you are correct that the XamTextEditor does not provide the "Uppercase" property or any other character casing related properties, there is still something you can implement on the XamTextEditor to get the values to appear as uppercase. I would recommend that you look into the ValueToDisplayTextConverter property. If you create an IValueConverter class and place the following code in its Convert method, I believe you will be able to convert your value to be uppercase by applying this converter to the XamTextEditor's ValueToDisplayTextConverter property:
if(value is string){ return ((string)value).toUpper();}