Rex,
>All,
>
>Maybe more information will be helpful. I have created a custom control subclassing mmDropDownList including a mmBusinessObject as a child control. The CreateChildControl method is:
>
> protected override void CreateChildControls()
> {
> Controls.Clear();
>
> oCounties = new Counties();
>
> this.BindingSource="Counties";
> this.BindingSourceDisplayMember = "County";
> this.BindingSourceValueMember = "CountyId";
> }
>
>When I drop this control on a form, the BindingSource, BindingSourceDisplayMember, and the BindingSourceValueMember are all blank. Do I need to run the this.EnsureControls() method is run before Rendering the control?
>I think that you still need to call your BO's method to retrieve your County data in a County dataset, and after setting the dropdown porperties, databind the control to the dataset. Here's an example.
# region TopLevelClass BO
this.oTopLevelClass = (TopLevelClass)this.RegisterBizObj(new TopLevelClass());
DataSet DSTopLevel = this.oTopLevelClass.GetDataSet();
Session["TopLevelClass"] = DSTopLevel;
if(Session["TopLevelClass"] == null)
{
throw new Exception("get dataset error");
}
# endregion
# region Parent Class Dropdown Setup
if (!IsPostBack)
{
this.cboParentClass.DataSource = DSTopLevel;
this.cboParentClass.DataTextField = "classname";
this.cboParentClass.DataValueField = "classid";
this.cboParentClass.DataBind();
}
# endregion
Kendall Webb
Senior Software Engineer
MCAD.Net/MCSD.Net