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

show tooltip on radgrid

2 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
a
Top achievements
Rank 1
a asked on 24 Dec 2011, 11:54 AM

 i want to shows tooltip on my radgrid, below is my code it show s the tooltip

 but here there is one problem , it shows same records i means same result  on each tooltip

 but when i debug the application the testVal will be shows different result in tooltip.

 can you plz suggest me or give me a sample code on same.,

i will be very much thanx

protected void gv_ItemDataBound(object Sender,GridItemEventArgs e)
{

 string textVal= "";
if(e.Item is GridDataItem)
{
 GridDataItem dt = e.Item as GridDataItem;
 // here code will come to retrive data frm database

 if(ds.Tables[0].Rows.Count >0)
 {
   testval = ds.Tables[0].Rows[0]["val"].ToString();
 }
 else
 {
   testval = " No Records";
 }
e.Item.ToolTip = testval;
}
}

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Dec 2011, 05:48 AM
Hello,

Try the following code snippet.
CS:
protected void grid1_ItemDataBound(object sender, GridItemEventArgs e)
 {
   foreach (TableCell cell in e.Item.Cells)
   {
      cell.ToolTip = cell.Text;
   }
 }

Thanks,
Princy.
0
a
Top achievements
Rank 1
answered on 26 Dec 2011, 07:01 AM
i have try that its not working,

here i m getting   on each records,

here my problem is i am getting same tooltip on each records can you plz suggest wht happen exactly.

Tags
General Discussions
Asked by
a
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
a
Top achievements
Rank 1
Share this question
or