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

Grid tootip

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 19 Apr 2010, 04:24 PM
Hi

I have a issue in tooltip

I used this code in both ItemDataCreated and ItemDatabound events
if(e.Item is GridDataItem)  
{  
   foreach(TableCell cell in e.Item.Cells)  
   {  
       cell.ToolTip = cell.Text;  
   }  

always cell.Text  is empty or &nbsp all the column in my grid is Template Column

regards
Vairamuthu



1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Apr 2010, 10:10 AM
Hi Vairam,

Try the following approach in order to add ToolTip for GridTemplateColumn.

C#:
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            item["CustomerID"].ToolTip = (item.DataItem as DataRowView)["CustomerID"].ToString(); 
            item["CompanyName"].ToolTip = (item.DataItem as DataRowView)["CompanyName"].ToString(); 
        }  
    } 

Regards,
Princy.
Tags
Grid
Asked by
vairam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or