Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to add a "tooltip" or "onhoover" or something to the values in a drop down list. I want to have an explanation to each "row" in the drop down... Is this possible?!

 

The drop down is created as a user control which I then use on my aspx page.

 

Ascx page:

<asp:ObjectDataSource ID="mObjectDataSource" runat="server" 
   SelectMethod="SelectAll" TypeName="DB.MasterDao">
</asp:ObjectDataSource>

 

 

CodeBehind:

    
Public ReadOnly Property MasterDropDownList() As DropDownList
       Get
           Return mMasterDropDownList
       End Get
   End Property

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       If Not IsPostBack Then
           BindControls()
       End If
   End Sub

Private Sub BindControls()
       BindControl(mMasterDropDownList)
       'other code
   End Sub

Private Sub BindControl(ByVal pControl As DropDownList)
       With pControl
           Dim i As New ListItem
           i.Text = "All" 'The first item in drop down says "All" (if user wants to search for all)
           i.Value = 0
           .Items.Clear()
           .Items.Add(i)
           If .SelectedIndex <> 0 Then
               .DataBind()
           End If
       End With
   End Sub

 

I see that I can in the Sub BindControl set tooltip for pControl, but I don't get any results by for exmple writing .tooltip = "test".

 

Anyone out there who knows how to do this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...