Yeah, that is true. I just didn't get that impression. ;-)
"Sergey Polyakov" <sergey_03@list.ru> wrote in message
news:uwTmHKbQEHA.1312@TK2MSFTNGP12.phx.gbl...
> Hi Teemu,
>
> > And about ViewState, if you add these ListItems to the Items on every
> > request (as happens with AddParsedSubObject), adding them to the
ViewState
> > is overhead.
>
> It's not overhead if you want to change the item collection dynamically at
> run-time.
>
> Sergey
>
> "Teemu Keiski" <joteke@aspalliance.com> wrote in message
> news:e6hhvSkPEHA.3596@tk2msftngp13.phx.gbl...
> > Hi,
> >
> > wouldn't it be easier to map the ListItems to the Items property (as it
> > happens with DDL), when you wouldn't need to deal with
AddParsedSubObject
> as
> > this mapping happens automatically when control has ParseChildren(true),
> > PersistChildren(false) attributes applied (that is, it inherits from
> > WebControl). These attributes have impact that content between control's
> > tags need to map to the property or properties of the control.
> >
> > DropDownList has Items property declared with
> > PersistenceMode(PersistenceMode.InnerDefaultProperty) so that all items
> > between begin and end tag must map to the Items property.
> >
> > And about ViewState, if you add these ListItems to the Items on every
> > request (as happens with AddParsedSubObject), adding them to the
ViewState
> > is overhead.
> >
> > --
> > Teemu Keiski
> > MCP, Microsoft MVP (ASP.NET), AspInsiders member
> > ASP.NET Forum Moderator, AspAlliance Columnist
> >
http://blogs.aspadvice.com/joteke > >
> >
> > "Michael Combs" <michaelacombs@hotmail.com> wrote in message
> > news:c64a6e8f.0405181414.917c860@posting.google.com...
> > > I am building a combobox webcontrol which works from a collection of
> > > ListItems similar to a standard DropDownList. It uses
> > > AddparsedSubObject to load the nested ListItem objects (below).
> > >
> > > <cc1:combobox id="ComboBox1" runat="server">
> > > <cc1:ListItem Text="test1" Value="1"
> > > Selected="False"></cc1:ListItem>
> > > <cc1:ListItem Text="test2" Value="2"
> > > Selected="False"></cc1:ListItem>
> > > </cc1:combobox>
> > >
> > > I am also overriding Load and Save viewstate to maintain the listitems
> > > in the viewstate. AddParsedSubObject is always called, in which the
> > > nested ListItems are loaded into my item list. Then in LoadViewState,
> > > I'm clearing my item list and loading the list items from the
> > > viewstate. Is this the correct method for handling this situation?
> > >
> > > Thanks,
> > > Michael Combs
> >
> >
>
>