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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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