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

[Solved] Tooltip for each Grid Cell?

2 Answers 299 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sivarajan Raju
Top achievements
Rank 1
Sivarajan Raju asked on 11 Dec 2009, 01:27 PM
Hi,
I am facing a problem in binding a tooltip to each cell. The tooltip value is the actual content in the cell. I have tried few solution to bind discussed in this forum. But i was not sucessful. 
Telerik version: 2009.2.826.35

 

<telerik:RadGrid ID="RadGrid1" runat="server"
        onitemcreated="RadGrid1_ItemDataBound">
            <ClientSettings AllowColumnsReorder="True" AllowKeyboardNavigation="false"
                                        ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="True">
                                        <Selecting AllowRowSelect="True" />
                                        <Resizing AllowColumnResize="True" AllowRowResize="True"  ClipCellContentOnResize="true" />
                                    </ClientSettings>
            <MasterTableView>
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            </MasterTableView>
    </telerik:RadGrid>

 

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
           
            if (e.Item is GridDataItem)
            {
                foreach (TableCell cell in e.Item.Cells)
                {
                    cell.ToolTip = cell.Text;
                }
            } 
 
        }

Please suggest some solution.
Regards,
Sivarajan

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Casey
Top achievements
Rank 1
answered on 11 Dec 2009, 02:28 PM
Hi Sivarajan,

Please modify your ItemDataBound method to match the following and it should work.

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
           foreach (TableCell cell in e.Item.Cells)  
            {  
                    cell.ToolTip = cell.Text;  
            }  
        } 

Hoep this helps!
Casey
0
Princy
Top achievements
Rank 2
answered on 14 Dec 2009, 06:44 AM
Hello Sivarajan,

The following help document should provide you with an alternative solution to add tooltips to your grid cells. Take a look at it:
Adding tooltips for grid items

Thanks
Princy.
Tags
Grid
Asked by
Sivarajan Raju
Top achievements
Rank 1
Answers by
Casey
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or