Nested propertiies not set at design time from properties window



Guess my other post was too long. Maybe this is more to the point.

Here is a composite control...can't get much simpler:

[ToolboxData("<{0}:TestControl runat=\"server\"></{0}:TestControl>")]
public class TestControl : CompositeControl
{
private TextBox tb = new TextBox();

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
NotifyParentProperty(true)]
public TextBox TextBox
{
get { return tb; }
set { tb = value; }
}

protected override void CreateChildControls()
{
base.CreateChildControls();
this.TextBox.ID = "TB1";
this.Controls.Add(TextBox);
}

}


In an aspx page this can then be done:

<ewc:TestControl ID="TestControl1" runat="server" >
<TextBox Height="55"></TextBox>
</ewc:TestControl>

When switching to design mode and expanding the "TextBox" property the
height shows up properly. If I try to change the value from the properties
window it won't set it in the html. It stays at 55 when switching to html
mode. Then when switching back to design mode it shows up as 55, the
original value. In fact this behavior happens for all of the "TextBox"
properties. None of its properties can be set from the properties window.

What's wrong with this?
Does anyone have a solution?


Thanks,
Gery


.



Relevant Pages

  • Re: Reference to free-form textboxes
    ... textbox floating over the cells of a normal worksheet rather than on a ... Press triangle to enter Design Mode. ... Press Textbox to view properties ... >> I insert a text box into Sheet1 of Excel and want to assign a value to ...
    (microsoft.public.excel.programming)
  • Re: Composite Control Attributes
    ... I understand that I can add attributes to the textbox from within the ... How can I expose this via the composite? ... > composite control itself. ... >> Alphonse Giambrone ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • RE: Textbox font colour change?
    ... Go into design mode and press the triangle. ... press the textbox and select the property icon on the tool bar. ... Private Sub TextBox1_BeforeUpdate ...
    (microsoft.public.excel.misc)
  • Re: Scroll bar adding to text box
    ... Did you use the textbox from the control toolbox toolbar? ... you can enter design mode. ... Rightclick on the textbox, choose properties and make a few changes. ... Quick question I have a text box and want to add a scroll bar to it how can ...
    (microsoft.public.excel.misc)
  • Re: Text box outline
    ... And if it's a textbox from the Control Toolbox toolbar. ... Show that control toolbox toolbar and click the design mode icon. ... rightclick on the textbox and choose properties ...
    (microsoft.public.excel.misc)

Loading