-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Jayant_Magic
Message 8 in Discussion
Hi, the code of looping is correct but hpw it is implemented is i suppose
causing issues.Proper steps to implement this code is:
To solve the problem I searched the internet but no appropriate solution was
found. Although some good third party controls were available which could
display the contents using a combination of button, edit box and div etc. But
their management was also a problem. A solution that came into mind was to
display the tool tip along every element of control so that text of non visible
area could be viewed using tool tip. The tool tip will be binded at server side
and will work for both firefox and internet explorer. Following is the code for
binding tool tip with a control. // // This method binds tooltip with a
dropdown/ any list control // public static void BindTooltip(ListControl lc) {
for (int i = 0; i < lc.Items.Count; i++) {
lc.Items[i].Attributes.Add("title", lc.Items[i].Text); } }
Here the "title" attribute is the magic which adds the tooltip with each list
item.
All you have to do is to call this function after binding all the values with
the control. You can save this code in your helper file and call where ever you
need it. If you have more then one control in your page for which you want to
attach the tool tip, you don't need to call this function many time but simply
call another overload of it. This overload function will search the list boxes
in the page and will attach the tool tip against every control that it will
find. public static void BindTooltip(System.Web.UI.Page p) { if (p == null
|| p.Form == null) return; BindTooltip(p.Form.Controls); }
To make the work more easy you can just put the code in master page. Every page
that uses the master page will get the tooltip automatically as shown in
sample.
For more info visit this link:
http://www.codeproject.com/useritems/List_Box_Tool_Tip.asp
Regards
Jayant
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]