Group: StrataFrame Users
Posts: 223,
Visits: 893
|
When I am binding the BO.CurrentDataTable to Strataframe.DevEx.ComboBox, the custom field is missing.
Here is the code I am using for binding. The custom field name is "DisplayDescription".
using (CostCodesBO loBO = new CostCodesBO())
{
loBO.FillAll();
cboCostCodes.ValueMember = "coco_PK";
cboCostCodes.DisplayMember = "DisplayDescription";
cboCostCodes.DataSource = loBO.CurrentDataTable;
}
Here is the BO Custom Field code:
protected override MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
//--Create and return a new array of FieldPropertyDescriptor objects
return new MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] {
new MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("DisplayDescription", typeof(CostCodesBO))};
}
/// <summary>
/// DisplayDescription
/// </summary>
/// <remarks></remarks>
[Browsable(false), BusinessFieldDisplayInEditor(), Description("DisplayDescription"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public System.String DisplayDescription
{
get
{
return String.Format("{0} {1}", this.coco_Number, this.coco_Description);
}
}
|