471,045 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,045 software developers and data experts.

tooltip for each row in grid view

hi all,

i have a grid view where am displaying data from dataset. My dataset
consists of columns Customer name, surname, date requested, sales person,
file number , status and comments
I am displaying all columns in grid view except comments.

Now I want to have comments displayed (for each row) as tooltip when u hover
over particular row.

Does anybody know the code for this ?

Aug 1 '06 #1
2 9293

I've done it with a Web datagrid. The grid has a value column that's
hidden and a button that's visible. If the value column is empty it
shows the button. If the value is there it shows who pressed the button
and the tooltip is shown if notes were attached. In the ItemDataBound
event I get the underlying data to use to make desicions. I create a
label control on the fly and use it's ToolTip to show the tooltip. I
also wanted a different cursor so that's there also.

private void dgBids_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
if((e.Item.ItemType.ToString() == "Item" || e.Item.ItemType.ToString()
== "AlternatingItem") || e.Item.ItemType.ToString() == "EditItem")
DataRowView drv = (DataRowView)e.Item.DataItem;
string sRejected = e.Item.Cells[5].Text.Trim().Replace(" ","");
Button btnDis = (Button)e.Item.Cells[6].Controls[0];
if(sRejected.Length == 0 || sRejected.Equals("0"))
btnApp.Visible = false;
Label lb = new Label();
lb.Text = "Appr. by " + drv.Row["Approver"].ToString();
string tt = drv.Row["SupervisorNotes"].ToString();
lb.ToolTip = tt;

Hope that Helps
*** Sent via Developersdex http://www.developersdex.com ***
Aug 2 '06 #2

Sorry, I forgot. If you want to just deal with mouseover on the TR
(row) Dino Esposito has a great article about using CSS behaviors to get
a rowover type highlight. It does require you override the datagrid in
NET 1.1, but his examples help a lot to understand what you can do with


Again, hoping this helps

*** Sent via Developersdex http://www.developersdex.com ***
Aug 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Lars Netzel | last post: by
11 posts views Thread by Webster | last post: by
5 posts views Thread by Pavan | last post: by
3 posts views Thread by =?Utf-8?B?UmFq?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.