StrataFrame Forum

Control not binding to a custom property

http://forum.strataframe.net/Topic10654.aspx

By Greg McGuffey - 7/31/2007

I have a control that implements IBusinessBinding (a wrapper around TxTextControl). All works well until I obfuscate the dlls. Then I get an error that the control can't be bound and it asks if there is a field descriptor for the custom property. Well, there is and it isn't obfuscated, nothing in the BO is obfuscated (I'm not obfuscating my BOs at all). The control is obfuscated though.



I don't know enough about how all this binding stuff works to know what to look for (other than the field descriptor....which isn't obfuscated). What might be going wrong?



Thanks!


By Greg McGuffey - 8/1/2007

Here is the stack trace I'm getting:



BusinessLayerException

An error occurred while refreshing the data from field 'ProjectProcessBO.ProcessDescription' to property 'InnerHTML' on control 'tcMain.' Are you missing FieldPropertyDescriptor for a custom property?

ArgumentException

Cannot bind to the property 'InnerHTML' on the target control.

Parameter name: PropertyName



Source : MicroFour StrataFrame Business



Stack Trace:

at System.Windows.Forms.Binding.CheckBinding()

at System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent value)

at System.Windows.Forms.ControlBindingsCollection.AddCore(Binding dataBinding)

at System.Windows.Forms.ControlBindingsCollection.Add(Binding binding)

at MicroFour.StrataFrame.Business.BusinessLayer.AddBinding(Control ControlToRefresh, String PropertyName, String FieldName)

at MicroFour.StrataFrame.Business.BusinessLayer.RefreshControl(IBusinessBindable ControlToRefresh, Boolean DataPresent)

at MicroFour.StrataFrame.Business.BusinessLayer.RefreshBoundControls()

at MicroFour.StrataFrame.Business.BusinessLayer.raise_CurrentDataTableRefilled()

at MicroFour.StrataFrame.Business.BusinessLayer.OnCurrentDataTableRefilled()

at MicroFour.StrataFrame.Business.BusinessLayer.ChangeCurrentDataTable(DataTable NewTable, Boolean AcceptChanges, Boolean IsSharedTable)

at MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(DbCommand CommandToExecute)

at FOXSystems.RAMS.BusinessObjects.Project.ProjectProcessBO.FillByProject(Int32 projectID)

at FOXSystems.RAMS.MitaAnalysis.x54a16ae912917adb.x404c743874643dfe(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)

at System.EventHandler.Invoke(Object sender, EventArgs e)

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)

at System.Windows.Forms.Form.OnCreateControl()

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WmShowWindow(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)





The one obfuscated method is the form load method of the form being loaded with data.
By Greg McGuffey - 8/1/2007

Well, your sneaky plan worked (the one were you put off replying to the post, cause you figure I'll find an answer in the mean time) Wink



I was obfuscating the properties on the control that I was binding to. The property that is bound is stored as text, so after obfuscation, the property name changed and boom. I marked those properties that might be used for binding to not be obfuscated and it works BigGrin
By Trent L. Taylor - 8/2/2007

Yeah, obfuscation is a great tool...but sometimes = problems to work through BigGrin