DropDownList - ToolTip

Discussion in 'ASP .Net' started by =?Utf-8?B?T3Jlbg==?=, Apr 10, 2006.

  1. hi all,
    i tried to create foreach item in DropDownList a ToolTip.
    It doesn't work. any idea ?

    DropDownList ddl;
    DataTable dt = (DataTable)Session["list"];
    foreach (DataRow dr in dt.Rows)
    {
    ListItem li = new ListItem(dr["name"].ToString(),
    dr["id"].ToString());
    li.Attributes["title"] = "1111";
    ddl.Items.Add(li);
    }
     
    =?Utf-8?B?T3Jlbg==?=, Apr 10, 2006
    #1
    1. Advertising

  2. ListItem renders as an option html element which doesn't support title
    property.

    Eliyahu

    "Oren" <> wrote in message
    news:...
    > hi all,
    > i tried to create foreach item in DropDownList a ToolTip.
    > It doesn't work. any idea ?
    >
    > DropDownList ddl;
    > DataTable dt = (DataTable)Session["list"];
    > foreach (DataRow dr in dt.Rows)
    > {
    > ListItem li = new ListItem(dr["name"].ToString(),
    > dr["id"].ToString());
    > li.Attributes["title"] = "1111";
    > ddl.Items.Add(li);
    > }
     
    Eliyahu Goldin, Apr 10, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?T3Jlbg==?=

    Nicolás Kittsteiner

    Joined:
    Oct 31, 2006
    Messages:
    2
    I succeded showing the tooltip using an ajax enabled control (MagicAjax)

    You must create a SelectedIndexChanged Event
    Code:
    Private Sub ddlIndicadores_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlIndicadores.SelectedIndexChanged
    [COLOR="SeaGreen"]' This refers to a database[/COLOR]
                Dim objIndicadores As New Indicadores
    
    [COLOR="SeaGreen"]' Next I select the text sending the value param to a function...[/COLOR]
                objIndicadores.Seleccionar(CType(ddlIndicadores.SelectedValue, Integer))
    
    [COLOR="SeaGreen"]' ...and returning the value[/COLOR]
                ddlIndicadores.Attributes("title") = objIndicadores.Nombre
            End Sub
    
    Note to use ddl.AutoPostBack set to TRUE in the Page_Load, and if you don`t use a database you can success using a Enum for the items in the ddl.
     
    Nicolás Kittsteiner, Oct 31, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucky
    Replies:
    0
    Views:
    2,430
    Lucky
    Dec 22, 2005
  2. Radu
    Replies:
    1
    Views:
    578
    Bruce Barker
    Jan 8, 2007
  3. =?Utf-8?B?UGFkYW0=?=
    Replies:
    4
    Views:
    1,474
    John Saunders [MVP]
    Apr 19, 2007
  4. Laurahn
    Replies:
    1
    Views:
    835
    Steven Cheng[MSFT]
    Jun 11, 2007
  5. ken bus

    DropdownList's tooltip not functioning

    ken bus, Aug 29, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    132
    Scott M.
    Oct 12, 2004
Loading...

Share This Page