473,569 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

listview does not display contents

After the following subroutine executes, my listview shows a scroll bar on the right, but it is otherwise blank. I've checked for things like locked=false, visable=true, font color same as background, but I don't see anything that should be hiding the contents. I've inserted various msgbox lines to display listview1.Items .Count, and these show that the listview does have data in it. I'm lost

The code (it's not very long)

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Clic
Dim dt As DataTabl
Dim dc As DataColum
Dim dr As DataRo
Dim lvi As ListViewIte
Dim lvsi As ListViewItem.Li stViewSubIte
Dim idx As Intege

Me.OracleDataAd apter1.Fill(Me. DataSet11

dt = Me.DataSet11.Ta bles(0
Me.Label1.Text = dt.Rows.Count & " items found.

Me.ListView1.Vi ew = View.Detail

For Each dc In dt.Columns ' load column header
ListView1.Colum ns.Add(dc.Colum nName, -1, HorizontalAlign ment.Left
' MsgBox(dc.Colum nName
Nex

For Each dr In dt.Rows ' load dat
lvi = New ListViewIte
If IsDBNull(dr.Ite mArray(0)) Then ' load primary ite
lvi.Text = "
Els
lvi.Text = dr.ItemArray(0
End I
For idx = 1 To dt.Columns.Coun t - 1 ' load subitem
If IsDBNull(dr.Ite mArray(idx)) The
lvi.SubItems.Ad d(""
Els
lvi.SubItems.Ad d(dr.ItemArray( idx).ToString()
End I
Nex
ListView1.Items .Add(lvi
Nex

MsgBox("end"
End Su
Nov 20 '05 #1
1 1214
Cor
Hi Rallard,

Nice routine,

I think there is only a very little thing in it.
ListView1.Colum ns.Add(dc.Colum nName, -1,

HorizontalAlign ment.Left)

The width -1 is not what it has to be I think, can you try to set it on
another value?

I hope this is the errror?

Cor
Nov 20 '05 #2

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

Similar topics

3
2796
by: andrewcw | last post by:
I have a simple winform with the following code. But although I can read back the info, the display fails to provide the text or the cell background color changes. private void ListViewBroke() { listView.View = View.Details; ArrayList LVcolTitles= new ArrayList(); LVcolTitles.Add("Drive"); LVcolTitles.Add("Cust");
6
4623
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline(); listView1.Items.Add (myString); } Is there a way I can fill up the second column this easily? Thw way I'm currently doing it is using the subitems...
2
4714
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add images to listview also(This is to list all the items in my inbox, and want to give the user the feel of outlook). Since it hangs for even 1000 items...
0
2607
by: Martin Streller | last post by:
Hello, The code below represents a simple ownerdrawn, Listview class in C#. Its purpose is to avoid the flicker of the MS ListView. So I can't fall back to their one. Does anybody know why I cannot change the size of the ListView's font (ListView.Font) from e.g.
6
2520
by: Vanessa | last post by:
With this program I can do one selection, but upon the second I get an error where ///////////////// is indicated. Please help. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
0
12270
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str; item.SubItems.Add(str); In the example code that follows, using the first line (in the ListView constructor) causes the later redisplay of values (to some specified...
4
6075
by: gene kelley | last post by:
I had a VB6 app that used a third party ListView control to simply display various recordsets. The control had a VirtualMode which I used for this display. Now in VB2005, I want to do the same with the native ListView to display various datasets in VirtualMode. I have a ListView with the VirtualListSize set and the appropriate columns in...
0
2299
parshupooja
by: parshupooja | last post by:
Contact Reply 1 point Member propoo Joined on 08-31-2007, 10:32 PM Posts 3 Hey all ,
0
5949
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 show as yellow until I've clicked the same item two times. What am I doing wrong on the selected item that keeps it from changing to yellow until...
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8130
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...
1
7677
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...
0
7979
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...
0
6284
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...
1
5514
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...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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...
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.