473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

[c# winform] ListView MultiColumn, Icon and ToolTip

77
Hi, ive been trying to produce something using a listview control which shows error messages for the emails sent from my application. Its a wierd concept so im going to try explain it best i can. I want to be able to have 3 items across the listbox each with a icon and a tooltip. Something similar to the below.. Item 1 has a icon next to it and when i hover over it i get a tooltip displaying the error message. Then the same again for items 2,3,4 etc.etc.
Expand|Select|Wrap|Line Numbers
  1. |  Item 1 | Item 2 | Item 3 |
  2. |  Item 4 | Item 5 | Item 6 |
  3.  

Heres the code i have at the moment which only does single column.
Expand|Select|Wrap|Line Numbers
  1. foreach (DataRow row in ds1.Tables["Receipitants"].Rows)
  2.             {
  3.                 if (row.ItemArray[1].ToString() != null)
  4.                 {
  5.                     if (row.ItemArray[1].ToString().Length > 0)
  6.                     {
  7.                         ListViewItem lvi = new ListViewItem(row.ItemArray[3].ToString() + " (" + row.ItemArray[1].ToString() + ")");
  8.                         lvi.ToolTipText = row.ItemArray[4].ToString();
  9.                         lvi.ImageIndex = 0;
  10.                         listView1.Items.Add(lvi);
  11.                     }
  12.                     else
  13.                     {
  14.                         ListViewItem lvi = new ListViewItem(row.ItemArray[3].ToString());
  15.                         lvi.ToolTipText = row.ItemArray[4].ToString();
  16.                         lvi.ImageIndex = 1;
  17.                         listView1.Items.Add(lvi);
  18.                     }
  19.                 }
  20.                 else
  21.                 {
  22.                     ListViewItem lvi = new ListViewItem(row.ItemArray[3].ToString());
  23.                     lvi.ToolTipText = row.ItemArray[4].ToString();
  24.                     lvi.ImageIndex = 1;
  25.                     listView1.Items.Add(lvi);
  26.                 }
  27.             }
  28.  
row.ItemArray[0] = ID;
"" "" [1] = email address
"" "" [4] = Error Message

Anyone know how i may go about producing what i need. I'm hoping theres an option im missing. I tried using 3 columns with sub items but subitems dont allow icons or tooltips.


Many Thanks,
Piercy
Mar 12 '08 #1
1 7810
piercy
77
After playing some more i manged to use the tile view to display how i need. However, Ive got a wierd problem where the icons sometims display and some times dont. There does not seem to be any pattern to them not loading. Ive tried starting the program waiting fopr 5 mins then opening the form (onclick of button). Ive tried rushing through and seeing if it makes a difference but i still can work it out. It seems completly random, i saw a post where some one else experienced the same problem but there were no replys. Any one seen this? Anyone got any ideas on how to fix this?

Many Thanks,
Piercy

ps. i didnt think it was necersery to create a new thread for this.. altho i will if need be.
Mar 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: scoobydoo | last post by:
hi, I have a problem displaying icons at the right colour depthin a ListView. I've made an icon file, (using IconWorkshop 5), it has 3 icons within it. A 32x32 32bpp XP style icon, a 32x32...
1
by: Víctor | last post by:
I'm doing a kind of file explorer with some additional funcionalities. The problem is that I'm not able to draw file extension icons in a ListView. I know how obtain icons, but when I try to draw...
2
by: Ken | last post by:
Hi all, Please help! I'm attempting to apply tooltips to each individual item in VB.Net's Listview control. In VB6 it was easy - you just did the following (assumes "myListView" is the name of...
1
by: Dino Buljubasic | last post by:
Is it possible to add tooltip to a listview item? Thanks, Dino
2
by: Amjad | last post by:
Hi, How do I display a tooltip when mouse hovers on top of an item of a ListView? I want the tooltip to contain the text of the item the mouse is pointing at. Amjad
0
by: Prakash | last post by:
Hi Friends, I am developing scheduler application using C#. In my application i have provide the list view control for displaying the scheduled items. The listview control having the following...
10
by: Rob | last post by:
VS 2005 How can you tell if a value is contained in a specific column (let's say column 1 named Status) of a ListView ? In a list box you could go... If ListBox1.Items.Contains(strWhatever)...
2
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the...
0
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a listview that when I select an item, it populates a details view. I want to show the item that was selected in the listview by changing it to yellow. Trouble is, the selected item does not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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,...

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.