N
NiXHex
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.Design.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?
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.Design.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?