Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb User Control Populate Items via XML
    primarykey
    data
    text
    <p>I have a web user control name as Chart Control, and I have a drop down List inside Chart Control I want to populate DropDown List of Chart Control like this:</p> <pre><code>&lt;UC:ChartControl ID="abc" runat="server"&gt; &lt;ChartDropDownItems&gt; &lt;asp:ListItem Text="Graph_Amount_Items_Sold" Value="0"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Graph_Ranking" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Graph_Share_Amount_Items_Sold" Value="2"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Graph_Share_Unit_items_Sold" Value="3" Selected="True"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Graph_Unit_items_Sold" Value="4"&gt;&lt;/asp:ListItem&gt; &lt;/ChartDropDownItems&gt; &lt;/UC:ChartControl&gt; </code></pre> <p>in .cs code</p> <pre><code> [DefaultProperty("ChartDropDownItems"), ParseChildren(true, "ChartDropDownItems"), PersistChildren(false), ToolboxData("&lt;{0}:ChartControl runat=\"server\"&gt; &lt;/{0}:ChartControl&gt;")] public partial class ChartControl : System.Web.UI.UserControl { private List&lt;ListItem&gt; lst; [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [PersistenceMode(PersistenceMode.InnerProperty)] public List&lt;ListItem&gt; ChartDropDownItems { set { lst = value; Bind_ddChartChange(); } } private void Bind_ddChartChange() { if (lst != null) { ddChartChange.DataSource = lst; ddChartChange.DataTextField = "Text"; ddChartChange.DataValueField = "Value"; ddChartChange.DataBind(); ListItem li = lst.Find(x =&gt; x.Selected == true); ddChartChange.SelectedValue = li.Value; } } } </code></pre> <p>When I compile and run it works fine for me, but at design time it says</p> <pre><code>"Error Creating Control" "Type'System.Web.UI.Control' does not have a public property named 'ChartDropDownItems'" </code></pre> <p>I want to work it even at design time. Can any body suggest me accordingly ? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload