Subclassing an Object

Posted on 2007-11-29
Last Modified: 2013-11-26
Hello experts:

I am trying to implement a solution that will display a radiobuttonlist to the user that is populated from a dataset.  I am currently using the datavaluefield and datatextfield properties to utilize the specified column in the dataset; however, I'd like to add some addition attributes to each radio button in the list that are populated when the radiobuttonlist is bound to the dataset ..

I have already created a class and inherited the radiobuttonlist class, but I'm not sure where to go from here ... any help is greatly appreciated.

For example, I'd like to  attach 3 other pieces of data:

radio1.DataValueField = "id"
radio1.DataTextField = "displaycolumn"
radio1.SubscriberID = "subscriberID"  <--- new
radio1.GenKey = "consumergenkey" <--- new
radio1.CustCov = "custcovnumber" <--- new
Question by:escheider
  • 2
  • 2
LVL 16

Expert Comment

ID: 20379563
I see where you having problems, check out the examples here
LVL 11

Expert Comment

by:Mihai Stancescu
ID: 20394038
You can add them in the radio button Tag property as a enum or custom class, or you can create a new radio button component and add the 3 new properties.

Hope this helps!


Author Comment

ID: 20400209

Do you have an example and will attaching these new properties properly attach the specified column to that property?
LVL 11

Accepted Solution

Mihai Stancescu earned 500 total points
ID: 20401261
Does your radio button list has the DataSource member? If so it also has an event for binding?

Check this link, and see if this helps you:

Hope this helps!

Author Closing Comment

ID: 31411796
Exactly what I needed!  Thanks!

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question