hi,
I have created radiobutton in Listbox control at runtime and set different values for each radiobutton using tag property.
How can I get the corresponding Tag value When I check on any Radio Button.
Please help me on this.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Master BillaRank #2,229 · 630 reputationPosted Aug 13, 2009, 12:45 AM EDT
Just you can this code to that
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
RadioButton ds = (RadioButton)e.OriginalSource;
object tag = ds.Tag;
}
if it help all my previous and current post , please mark it answer.
thank you
Master BillaRank #2,229 · 630 reputationPosted Aug 13, 2009, 12:14 AM EDT
Yes u think my code help to earlier to create radio button in lisbox, now you need access the radio buttons.
And if you are bind like my code the radio button has Product object
so you need access like this way that control
Thank you
Ashok P7 reputationPosted Aug 13, 2009, 12:38 AM EDT
private void OnOptionCheck(object sender, EventArgs e)
{
var obj = sender as SurfaceRadioButton;
//obj.Tag
}
In the above code I can able to get the value on RadioButton Check event, But it shows in following format when i look into Watch window
obj.Tag {Attribute, Name="score", Value="15"} object {System.Xml.XmlAttribute}
How can I get the tag value from the object 'obj'?