tooltip for header

2 posts, 0 answers
  1. Saran kumar
    Saran kumar avatar
    58 posts
    Member since:
    Sep 2009

    Posted 21 Dec 2009 Link to this post

    if (e.Item is GridHeaderItem)  
                    {  
                        GridHeaderItem headerItem = (GridHeaderItem)e.Item;  
                        headerItem["CheckboxSelectColumn"].ToolTip = "Select all or Deselect";  
                        headerItem["imgHeader"].ToolTip = "Action Past Due";  
                        headerItem.Attributes["onmouseover"] = "this.style.background='#dde9ff'this.style.fontWeight='normal';this.style.cursor='pointer'";  
                        headerItem.Attributes["onmouseout"] = "this.style.background=''this.style.fontWeight='';this.style.cursor=''";  
                    } 
     hi im using the above code to display tool tip in the header section. but its is not geting insided the if loop. i need to do the mouse over color change too in that. please help. this same thing perfectly works for a data item.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Dec 2009 Link to this post

    Hello Saran,

    If you have enabled sorting for the grid, then the header cells would contain linkbuttons. If so, you would have to set the tooltip for the link buttons as shown below:
    c#:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
      { 
        if (e.Item is GridHeaderItem)   
         {   
           GridHeaderItem headerItem = (GridHeaderItem)e.Item;   
           headerItem[columnUniqueName].Controls[0] as LinkButton).ToolTip = "Custom Text";                    
         }  
      } 

    Also refer to the following document on how to set styles on hovering over header:
    Set style on mouse over

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top