CheckBoxList RadioButtonList and the RepeatXX properties??

N

Nobody

CheckBoxList and RadioButtonList have the same inheritence tree:

-INamingContainer
-IPostBackDataHandler
-IRepeatInfoUser
--ListControl
----WebControl
------Control
--------IComponent
----------IDisposable
--------IDataBindingsAccessor
--------IDisposable
--------IParserAccessor
--------Object
------IAttributeAccessor

They both have the following methods:
CreateControlStyle()
Render()

The both have the following properties:
CellPadding
CellSpacing
RepeatColumns
RepeatDirection
RepeatLayout
TextAlign

BUT!
They don't have a common base object or interface the specifies these
common methods and properties!

Was this designed this way on purpose? If so why?

The reason I'm posting this is that I was trying to write something
like:
if(ctl.GetType().IsSubclassOf(typeof(System.Web.UI.WebControls.ListControl)))
{
((ListControl)ctl).DataSource=dynamicTableDataSet.Tables["MultiSelectOptions"];
((ListControl)ctl).RepeatColumns=3;
((ListControl)ctl).RepeatDirection=RepeatDirection.Horizontal;
((ListControl)ctl).DataValueField=dynamicTableDataSet.Tables["MultiSelectOptions"].Columns[0].Caption;
((ListControl)ctl).DataTextField=dynamicTableDataSet.Tables["MultiSelectOptions"].Columns[1].Caption;
((ListControl)ctl).DataBind();
}

In this particular instance I don't really care if the control (ctl)
is a CheckBoxList or a RadioButtonList so why wouldn't they have a
common base object like ListControl that exposes all of these common
methods and properties?????

Thanks for your time.
Scott Wojan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top