Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Custom control collections - IList or ControlCollection

Reply
Thread Tools

Custom control collections - IList or ControlCollection

 
 
Mark
Guest
Posts: n/a
 
      04-27-2007
Dear community,

I am in the process of designing and writing a custom control that has child
controls of which I have derived from the Panel WebControl. I am becoming
confused as to the required implementation of the collection to hold the
child controls. I have started to implement a Collection class which inherits
from IList. I have followed roughly the implementation of the frameworks
ListItemCollection but have now started to become slightly confused about the
IStateManager implementation. Should I be going down this road or should my
control collection class just be derived from the ControlCollection class??

 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      04-27-2007
Just to add to my post, I have just been looking at some of the
System.Web.UI.WebControls implementations for WebControl collections and it
seems some opt for their collection classes to extend IList and some inherit
from ControlCollection. I was particularly interested in looking at the
disassembled MultiView, View and ViewCollection classes as this control seems
to be close to what my custom control is trying to acheive. Although, when I
modelled my collection class based on extending ControlCollection I had
difficulty when trying to cast out my type from a ControlCollection type in
the Items method.
What are the rules governing the implementation of custom child control
collections and managing viewstate? Am I right in thinking that because my
child controls inherit from existing web controls then I need not to worry
about viewstate management in the collection? I would be most grateful for
some advise on this topic.

"Mark" wrote:

> Dear community,
>
> I am in the process of designing and writing a custom control that has child
> controls of which I have derived from the Panel WebControl. I am becoming
> confused as to the required implementation of the collection to hold the
> child controls. I have started to implement a Collection class which inherits
> from IList. I have followed roughly the implementation of the frameworks
> ListItemCollection but have now started to become slightly confused about the
> IStateManager implementation. Should I be going down this road or should my
> control collection class just be derived from the ControlCollection class??
>

 
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
Skinfile overrides ControlCollection of custom control Gerrit Horeis ASP .Net Web Controls 0 04-12-2007 09:48 AM
GetEnumerator from custom collection implementing IList is not invokedon datagrid databind kaoskoder ASP .Net Datagrid Control 0 01-27-2004 09:22 AM
Inheriting System.UI.ControlCollection for a WebControl - FindControl doesn't work??? Harry F. Harrison ASP .Net 0 12-18-2003 06:28 PM
Sorting collections based on nested collections Doug Poland Java 9 09-27-2003 10:46 PM
InnerProperty Persistance for Collections containing other Collections mutex ASP .Net Building Controls 0 07-27-2003 02:45 PM



Advertisments