I want to have spell checking (the red underlines) enabled for textboxes in my XamDataGrid. I'm building the styles manually in C#, like this:
ret.Setters.Add(new Setter(TextBox.AcceptsReturnProperty, true));
newstyle.Resources.Add(typeof(TextBox), ret);
Then applying that style to the Field.Settings.EditorStyle
But SpellCheck is an attached property, so how can I do it?
Thanks
Ok I can almost get this working using an event handler:
newstyle.Setters.Add(new EventSetter(XamTextEditor.EditModeStartedEvent, new EventHandler<EditModeStartedEventArgs>(SpellCheckEditStart)));
And then..
{
}
This appears to work BUT comes up with erronious spelling mistakes! Almost as if it isn't word-breaking correctly (ie 'work' is a spelling error. Right click and select 'work' as a correction, and it shows 'workk', 2 k's).
Any ideas? Vol 2 hoxfix 1007
Try this:
Create a cutom Field which his editor is XamMasketTexbox.
then assume that f is an object of typeField and configure it:
f.DataType = typeof(string); f.Settings.EditAsType = typeof(string); f.Settings.EditorType = typeof(XamMaskedEditor);
Style s = new Style(typeof(XamMaskedEditor)); //Setter setterMask = new Setter(XamMaskedEditor.MaskProperty, mask); Setter setterMask = new Setter(XamMaskedEditor.MaskProperty, "{char:10:0-9a-zA-Z)"); s.Setters.Add(setterMask); f.Settings.EditorStyle = s;
If you need a list of rules to generarte masks follow this link:
http://help.infragistics.com/Help/NetAdvantage/WPF/2007.2/CLR3.X/HTML/xamEditors_Masks.html
Andrea