Oliver:
Whether you are working in WinForms or WebForms, the implementation will be basically the same. I think I did mislead you a little on the previous post because you will want to use the IWebBusinessBindable on the web side of things. From your post, I assume that you are creating a custom user control, and then wanting to bind to that control. My brain was on the WinForms side of things, but here, you are wanting to do web. But the process is the same.
For example, you may want to start with a WebControl as your base class, not a UserControl like on the WinForms. It depends on what you are trying to accomplish in your application. But for example:
using System;
using System.Collections.Generic;
using System.Text;
using MicroFour.StrataFrame.UI.Web;
namespace TestingWebControl
{
public class MyCustomWebControl : System.Web.UI.WebControls.WebControl, IWebBusinessBindable
{
#region IWebBusinessBindable Members
public bool BindingEditable
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string ErrorMessage
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool HasAdditionalBindings
{
get { throw new NotImplementedException(); }
}
public bool IgnoreManageUIReadOnlyState
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool InError
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
#endregion
#region IWebBinding Members
public MicroFour.StrataFrame.UI.BindingDirections BindingDirection
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string BindingField
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string BindingFormat
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string BindingProperty
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string BusinessObjectName
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
#endregion
}
}
The code above is a new web control that I created and then I implemented IWebBusinessBindable. Next, you can save a lot of time by opening the SF source code and pulling the implementation code from a web control, such as a textbox. So here in the next step, I started to "flesh" this out a little by creating the private fields and start implementing the properties using the type editors, etc. that are already built and ready for you to use through StrataFrame.
using System;
using System.Collections.Generic;
using System.Text;
using MicroFour.StrataFrame.UI.Web;
using MicroFour.StrataFrame.UI;
using System.ComponentModel;
using MicroFour.StrataFrame.Business;
using MicroFour.StrataFrame.Extensibility;
using System.Drawing.Design;
namespace TestingWebControl
{
public class MyCustomWebControl : System.Web.UI.WebControls.WebControl, IWebBusinessBindable
{
#region [ Private Fields ]
string _BindingField = string.Empty;
string _BindingProperty = "Text";
string _BindingFormat = string.Empty;
string _BusinessObjectName = string.Empty;
BindingDirections _BindingDirection = BindingDirections.TwoWay;
string _ErrorMessage = string.Empty;
bool _InError = false;
bool _IgnoreManageUIReadOnlyState = false;
#endregion
#region IWebBusinessBindable Members
public bool BindingEditable
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string ErrorMessage
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool HasAdditionalBindings
{
get { throw new NotImplementedException(); }
}
public bool IgnoreManageUIReadOnlyState
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool InError
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
#endregion
#region IWebBinding Members
public MicroFour.StrataFrame.UI.BindingDirections BindingDirection
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
[Category(BusinessMod.EDITOR_CATEGORY)]
[DefaultValue("")]
[Description(BusinessMod.EDITOR_BINDINGFIELD_DESC)]
[Editor(Constants.TE_WebBindingFieldTypeEditor, typeof(UITypeEditor))]
public string BindingField
{
get
{
return _BindingField;
}
set
{
_BindingField = value;
}
}
[Category(BusinessMod.EDITOR_CATEGORY)]
[DefaultValue("")]
[Description(BusinessMod.EDITOR_WEBBINDINGFORMAT_DESC)]
public string BindingFormat
{
get
{
return _BindingFormat;
}
set
{
_BindingFormat = value;
}
}
[Category(BusinessMod.EDITOR_CATEGORY)]
[DefaultValue("")]
[Description(BusinessMod.EDITOR_BINDINGPROPERTY_DESC)]
[Editor(Constants.TE_BindingPropertyEditor, typeof(UITypeEditor))]
public string BindingProperty
{
get
{
return _BindingProperty;
}
set
{
_BindingProperty = value;
}
}
[Category(BusinessMod.EDITOR_CATEGORY)]
[DefaultValue("")]
[Description(BusinessMod.EDITOR_BUSINESSOBJECT_DESC)]
[Editor(Constants.TE_BusinessObjectNameTypeEditor, typeof(UITypeEditor))]
public string BusinessObjectName
{
get
{
return _BusinessObjectName;
}
set
{
_BusinessObjectName = value;
}
}
#endregion
}
}
You can see the highlighted changes. At this point, you just continue to pull out of the SF code until you complete the implementation of the control. Next, you will want to bind to a property that represents the data in your control. This will be the BindingProperty of the implementation. So you can change the default value to meet your needs, but after that, SF should hook up and bind for you on your custom control.
I hope that this helps.