473,782 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ?

thanks
puja
Aug 1 '06 #1
2 9455


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_ItemData Bound(object sender,
System.Web.UI.W ebControls.Data GridItemEventAr gs e)
{
if((e.Item.Item Type.ToString() == "Item" || e.Item.ItemType .ToString()
== "AlternatingIte m") || e.Item.ItemType .ToString() == "EditItem")
{
DataRowView drv = (DataRowView)e. Item.DataItem;
string sRejected = e.Item.Cells[5].Text.Trim().Re place(" ", "");
Button btnDis = (Button)e.Item. Cells[6].Controls[0];
if(sRejected.Le ngth == 0 || sRejected.Equal s("0"))
{
btnApp.Visible = false;
Label lb = new Label();
lb.Text = "Appr. by " + drv.Row["Approver"].ToString();
string tt = drv.Row["SupervisorNote s"].ToString();
if(tt.Length)
{
lb.ToolTip = tt;
lb.Style.Add("c ursor","url('co mment.cur')");
}
e.Item.Cells[4].Controls.Add(l b);
}
}
}

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
behaviors.

http://msdn.microsoft.com/msdnmag/is...3/CuttingEdge/

Again, hoping this helps

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2991
by: Stephen | last post by:
Is it possible to add a tooltip in the column of a Datagrid. Can someone please show me how I would do this for the datagrid column below. Thanks for any help anyone can give me. Here is the datagrid coloum which I want to put the tooltip when the user hovers over it. <asp:BoundColumn DataField="ID" SortExpression="ID" HeaderText="ID"> <HeaderStyle ForeColor="White" CssClass="dgHeader"> </HeaderStyle>
2
1852
by: Stephen | last post by:
I'm trying to work with a datagrid column in order to display a tooltip in a datagrid cell. The reason I am doing this is because I have some long strings being returned and I don't want the rows of the datagrid expaning down to much. I basically want to display the first 50 characters in the grid cell and then display the rest as a tooltip in the grid cell. I'm not sure if this is possible but if anyone can help me do this I would be very...
1
2004
by: Lars Netzel | last post by:
I need to have a Tooltip on each Cell in a datagrid, I don't know how to do this. I'm using Styles to the datagrid (Which I asume most people do since you never need to show all the fields from the source). The Cell I want a tooltip on is styled with a textboxcolumn and the TextBox Object in that TextBox Column doesn't seem to have a property called Tooltip.. so i'm sorta stranded here... Best regards/ Lars
0
2135
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works really fine. No problems at all. But, when this control is placed inside a template of an Infragistics UltraWebTab control, somethings stranges happens: 1. When the WebForm is opened, an "Error Creating Control" message is displayed (for container...
11
3551
by: Webster | last post by:
Hello, I was wondering if there's a way to create a tooltip but add graphics to it. Currently I have a picturebox that I dynamically add graphics/labels/etc to, but when this "tooltip" is on the edge of the form, it gets cut off because of the form. So is there anyway to make a richer tooltip?? Or is there a way for my picturebox to float above (outside) of the form??
5
11816
by: Pavan | last post by:
My goal is to accomplish the tooltip functionality for all the neodes in a tree view and i have the following three Events in my C# application. Name of my TreeView Control (AITreeView) 1) AITreeView_MouseDown(object sender, MouseEventArgs e) 2) AITreeView_MouseUp(AITreeView_MouseDown(object sender, MouseEventArgs e) 3) AITreeView_Click(AITreeView_MouseDown(object sender, MouseEventArgs e)
2
4896
by: Mark Collard | last post by:
I've noticed that when you add a ToolTip component to a Form (or UserControl) the other controls on the form display a property in the property grid called "ToolTip on toolTip1", so you can set the tooltip text on the selected control. I'm currently writing my own component, and I want to add the same functionality to the component, so that the other controls on the form display a property in the property grid called "ControlText on...
2
7452
by: Rich | last post by:
Hello, Some database applicatins have a tooltip feature where when you are dragging the scrollbar of the table view a tooltip appears next to the mouse cursor displaying the approximate record number you are scrolling past (Excel, Access). Sql server has the rownumbers on the Row Header column of its table view. Ideally, I would like to add row numbers to the Row Header column of the datagridview like sql server - Any suggestions...
3
7280
by: =?Utf-8?B?UmFq?= | last post by:
I have a very unique requirement, I have to add a tooltip in a grid view control, the tooltip should be similar to this link: http://web-graphics.com/mtarchive/BubbleTooltips.html ...(hover at the link) Do you have any suggestion on this.. Thanks
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.