[ControlAddInExport("Astena.RichTextboxEditor")] public class RichTextBoxAddin: WinFormsControlAddInBase, IObjectControlAddInDefinition { public NavPanel Panel; private bool Loaded = false; protected override Control CreateControl() { Debug.WriteLine("CreateControl(): Control Loading"); Panel = new NavPanel(); return Panel; } public bool HasValueChanged { get { Debug.WriteLine("Get: HasValueChanged = "+Panel.EditorChanged); //Debug return Panel.EditorChanged; } } public object Value { get { Debug.WriteLine("Get: Value"); //Debug Debug.WriteLine(Panel.EditorValue); Debug.WriteLine("Get: Value: Reset Loaded bool");//debug Loaded = false; Debug.WriteLine("Get: Reset HasChanged"); Panel.ResetEditorChanged(); return Encoding.UTF8.GetBytes(Panel.EditorValue); } set { Debug.WriteLine("Set: Start"); //Debug byte[] data = (byte[])value; string input = ""; if(data != null) input = Encoding.UTF8.GetString(data); Debug.WriteLine("Input.Legth: "+input.Length); Debug.WriteLine("Set: Value - Input:"); Debug.WriteLine(input); if (data != null && !Loaded) { Debug.WriteLine("Set: Value - Data != null && !Loaded"); //Debug //Debug.WriteLine("Set: Value - Input:");//Debug //Debug.WriteLine(input);//Debug if (input.Length > 75) //min rtf text length is 119 (including the headers) { Debug.WriteLine("Set: Value - Input.Length > 75"); Panel.EditorValue = Encoding.UTF8.GetString(data); Loaded = true; //only here is valuable data loaded } else { Debug.WriteLine("Set: Value - Input.Length > 75"); Panel.EditorValue = ""; } } Debug.WriteLine("Loaded: "+Loaded); } } public event ControlAddInEventHandler ControlAddIn; }
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The interface "IObjectControlAddInDefinition" should normally handle the data.
Is the way that BLOB data is handled changed in 2013?
EDIT: I took a closer look to the used code in the 2009 R2 and noticed that at some point a calcfields is used. I think you might be wright about the calcfields.
I have the exact same situation here.
Everything was OK on 2009R2 and now not working anymore with 2013.
In fact I can enter data and see that it is stored corectly by using Jet Report to access it. But when I try to read and display it on textBox add-in, i get a special character and then 7 squares instead of the proper text...
Any ideas ?
Thanks.
But I also think that what we store is different.
Using the same object, saving the same text, what I see in sql in the blob is different for R2 and 2013.
Desperately need help!