Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Composite DropDownList Databinding issue

Reply
Thread Tools

Composite DropDownList Databinding issue

 
 
NiXHex
Guest
Posts: n/a
 
      10-25-2005
Hi,

I am trying to create a composite control which inherits from
system.web.ui.webcontrols.webcontrol that contains a dropdownlist
control and some validation logic and a label for any validation
messages. I want this DropDownList to auto-populate based off of
databindings I assign to it, specifically a DataSet or DataTable. The
composite control's DropDownList is accessible via the 'DDL' property.

After dragging the composite control onto a Web Form, and also dragging
a typed dataset, I want to assign the DataSet as the DropDownList's
DataSource, however the VB.Net designer doesn't allow me to do so in
the Properties tab (The DropDownList's DataSource property is greyed
out).

I am thinking it may be easier to give the composite control the
DataSource, DataMember, DataTextField, and DataValueField properties
and let the composite control deal with the DropDownList in
CreateChildControls().

So, my question is, what designer attributes do I have to assign to
those respective properties so that VS.Net lets me assign those
properties the same way that it does with an ordinary ListControl?

I added the
<TypeConverterAttribute(gettype(System.Web.UI.Desi gn.DataSourceConverter))>
attribute to the composite control's DataSource property, and this
_sort of_ works in VS.net, however in the ASP.Net source for the Web
Form, it creates the following:

<cc1ropDownList id="DropDownList1" runat="server"
DataSource="Players1"></cc1ropDownList>

I believe it should be the following instead:

<cc1ropDownList id="DropDownList1" runat="server" DataSource="<%#
Players1 %"></cc1ropDownList></P>

Further, this doesn't auto-populate the DataMember, DataTextField, or
DataValueField selectors in the VS.Net properties either.

Any ideas on how I can get this to work?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
databinding a Dropdownlist to another dropdownlist tshad ASP .Net 8 10-19-2005 10:00 PM
Composite vs non composite Controls Mike ASP .Net Web Controls 4 03-11-2005 05:47 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM



Advertisments