473,657 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckBoxList RadioButtonList and the RepeatXX properties??

CheckBoxList and RadioButtonList have the same inheritence tree:

-INamingContaine r
-IPostBackDataHa ndler
-IRepeatInfoUser
--ListControl
----WebControl
------Control
--------IComponent
----------IDisposable
--------IDataBindingsAc cessor
--------IDisposable
--------IParserAccessor
--------Object
------IAttributeAcces sor

They both have the following methods:
CreateControlSt yle()
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.W eb.UI.WebContro ls.ListControl) ))
{
((ListControl)c tl).DataSource= dynamicTableDat aSet.Tables["MultiSelectOpt ions"];
((ListControl)c tl).RepeatColum ns=3;
((ListControl)c tl).RepeatDirec tion=RepeatDire ction.Horizonta l;
((ListControl)c tl).DataValueFi eld=dynamicTabl eDataSet.Tables["MultiSelectOpt ions"].Columns[0].Caption;
((ListControl)c tl).DataTextFie ld=dynamicTable DataSet.Tables["MultiSelectOpt ions"].Columns[1].Caption;
((ListControl)c tl).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
Nov 18 '05 #1
0 1001

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5379
by: Tom | last post by:
Hi, I have a webform which has DropDownList, RadioButtonList and CheckBoxList. All values are in webform, but not select from DB table as they do not need to be used as search requirements. For DropDownList and RadioButtonList, there is only one item is selected and store in DB table.
1
2382
by: Empire City | last post by:
I have an ASP.NET form with a DataGrid and Button. I want to put a RadioButtonList in a DataGrid cell. I bind it to an ArrayList which has a ListItem in the cell. The display part works fine. I then check some boxes and hit the submit button. I can't seem to get the value that is selected on the RadioButton List. I don't want to use the EditTemplate thing I just want to click on the radiobutton and submit the form. I also don't want to do...
3
1720
by: Elad Volpin | last post by:
Can someone please explain this: I created a new webform with a PlaceHolder and a Button. My Page_Load contains the following code: private void Page_Load(object sender, System.EventArgs e) { ListControl l = null; ListItem item = new ListItem("a", "b");
0
2527
by: Boris | last post by:
When I dynamically create CheckButtonList, I add ListItem(s) to my CheckButtonList object chkList chkList.Items.Add(new ListItem("My Text", "My Value")); The resulting HTML doesn't contain value="My Value". Therefore, I can't access "My Value" with Request.Form on post back. I do get the desired outcome with my RadioButtonList object radioList when I do
4
6536
by: MattB | last post by:
I have a CheckBoxList that under some circumstances I want to only allow one selection, so that if you select a different item, whatever was selected before becomes un-selected. Any ideas on how to do this? Ideas, and even better, examples would be appreciated! Matt
14
7957
by: Satheesh Babu B | last post by:
hai.. am having a checkboxlist..now how do i get the value of the checkbox that is checked in checkboxlist using javascript? Thanks in advance.... Regards,
4
3112
by: adiweb | last post by:
I would like to use a radiobuttonlist in a windows form control but I know this is not possible because radiobuttonlists are only available in web forms. I am trying to use a checkboxlist instead and I am encountering problems. I do not want multiple checks. Any help is highly appreciated.
0
2141
by: webmaster | last post by:
Hi all, I'm tearing my hair out with this one. I have successfully implemented by own RadioButtonList in order to provide additional functionality and a DIV rather than TABLE-based layout in one of my ASP.NET 1.1 web forms. This involves a fairly simple inheritance of the System.Web.UI.WebControls.RadioButtonList class, with some new properties added and the Render sub overridden. When I come to render each radio item, I do the...
4
2418
by: Marty | last post by:
I am using: VS2005 Pro WinXP Pro SP2 IIS 5.1 ..NET Framework 2.0.50727 I create a website using File>New>Web Site>ASP.NET. I put a ListBox, DropDownList, CheckBoxList and RadioButtonList on the default page. Compile the page and surf to it using IE or Firefox (I get the same
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.