[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Subclassing an Object

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
radio1.databind
0
escheider
Asked:
escheider
  • 2
  • 2
1 Solution
 
SQL_SERVER_DBACommented:
I see where you having problems, check out the examples here http://www.markusegger.com/Articles/Article.aspx?quickid=050084
0
 
Mihai StancescuSoftware Engineer Commented:
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!

Regards,
Mishu
0
 
escheiderAuthor Commented:
Mishu:

Do you have an example and will attaching these new properties properly attach the specified column to that property?
0
 
Mihai StancescuSoftware Engineer Commented:
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:
http://www.codeproject.com/KB/cs/databindingwithattributes.aspx

Hope this helps!
Regards,
Mishu
0
 
escheiderAuthor Commented:
Exactly what I needed!  Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now