Adding Tooltip for RadioButtonList Elements
My is RadioButtonList
tied to the database like this:
SqlDataAdapter adapter = new SqlDataAdapter("SELECT ItemsID,ItemsDescription FROM Items", con);
adapter.Fill(subjects);
rblUseCases.DataSource = subjects;
rblUseCases.DataTextField = "ItemsDescription";
rblUseCases.DataValueField = "ItemsID";
rblUseCases.DataBind();
I need to add a new tooltip that will be displayed when the user hovers around any radio button. I am planning to add tooltip text as a new column Tooltip
in my database table Items
. How can I bind it to a switch?
+3
source to share
4 answers
The following code will display a tooltip on the radio button:
ListItem li=new ListItem("Manish","oopde");
li.Attributes.Add("title","zello");
RadioButtonList1.Items.Add(li);
For data binding, you can iterate over each element and add attributes to it. The databound and databinding event does not trigger for every item, which is why we had no other opportunity to implement the same.
+8
source to share