This is a migrated thread and some comments may be shown as answers.

tooltip for header

1 Answer 41 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Saran kumar
Top achievements
Rank 1
Saran kumar asked on 21 Dec 2009, 07:05 AM
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.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Dec 2009, 11:37 AM
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.
Tags
ToolTip
Asked by
Saran kumar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or