Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Self contained mmDropDownList control
Message
From
27/05/2004 12:11:07
 
 
To
27/05/2004 09:55:46
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00907668
Message ID:
00907798
Views:
6
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
		// TopLevelClass BO (Parent Class)
		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
		// setup the Parent Class combo
		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
Previous
Reply
Map
View

Click here to load this message in the networking platform