473,398 Members | 2,165 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,398 software developers and data experts.

ListView control issue

Hi,

Is there a limit on maximum number of columns in listview
control ? I am finding:

In a listview control (Report Format) I am displaying a
record with 400 fields. I am creating its column names
dynamically (Field-1, Field-2 ...). What I am finding
after Field-362, column names are just blank but in the
data row text is being displayed properly till 400th
field. This is the scenario in XP environment.

In Win-98 environment till records having 362 fields are
getting displayed, but if a record contains more than
this number, no data is being displayed.

The code is NOT throwing any error.

Regards

Vinay

Nov 20 '05 #1
10 2242
* "Vinay" <cu****@cursor.com> scripsit:
Is there a limit on maximum number of columns in listview
control ? I am finding:

In a listview control (Report Format) I am displaying a
record with 400 fields. I am creating its column names
dynamically (Field-1, Field-2 ...). What I am finding
after Field-362, column names are just blank but in the
data row text is being displayed properly till 400th
field. This is the scenario in XP environment.

In Win-98 environment till records having 362 fields are
getting displayed, but if a record contains more than
this number, no data is being displayed.


I didn't find any information about a limitation like this. Did you
have a look at the memory usage of the application?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Hi Herfried,

Thanks for your reply.

Can you please elaborate about the memory usage (what
should I check ...). From the outside I don't find any
sign that application is looking for more memory (I may
be wrong.)

Regards

Vinay
I didn't find any information about a limitation like this. Did youhave a look at the memory usage of the application?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #3
* "Vinay" <cu****@cursor.com> scripsit:
Thanks for your reply.

Can you please elaborate about the memory usage (what
should I check ...). From the outside I don't find any
sign that application is looking for more memory (I may
be wrong.)


It was only an idea. Maybe the application has memory problems when
adding 400 columns. You can check the memory usage with the task
manager. But, as you mentioned, I would expect an exception if there
are any problems with memory.

How many rows are you adding to the listview? Does the problem even
occur when you use this code to add column headers?

\\\
Dim i As Integer
For i = 1 To 400
Me.ListView1.Columns.Add("Column " & i.ToString(), 10, HorizontalAlignment.Left)
Next i
Me.ListView1.View = View.Details
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Herfried,

This issue is coming at the time of adding column headers
and adding of only 2 records in a listview control. As no
exception is being thrown, I am assuming things are
normal on memory side.

A difference is occuring when application is running in
Windows-XP and Win-98 environments.

a. In Win-XP I am able to see the record fields beyond
(362) but no column headers (for fields 363 onwards), but
in Win98 environment no data and column headers are
visible if record field size goes beyond 362.
Regards

Vinay
It was only an idea. Maybe the application has memory problems whenadding 400 columns. You can check the memory usage with the taskmanager. But, as you mentioned, I would expect an exception if thereare any problems with memory.

How many rows are you adding to the listview? Does the problem evenoccur when you use this code to add column headers?

\\\
Dim i As Integer
For i = 1 To 400
Me.ListView1.Columns.Add("Column " & i.ToString(), 10, HorizontalAlignment.Left)Next i
Me.ListView1.View = View.Details
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #5
* "Vinay" <cu****@cursor.com> scripsit:
A difference is occuring when application is running in
Windows-XP and Win-98 environments.

a. In Win-XP I am able to see the record fields beyond
(362) but no column headers (for fields 363 onwards), but
in Win98 environment no data and column headers are
visible if record field size goes beyond 362.


The sample code I posted previously created a listview with 400
columns. It is working fine on my Windows XP machine, all column
header captions are showing up as expected.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Hi Herfried,

Thanks for your reply.

I tried your sample code and it is creating 400 columns.

With this new input, I have started to track my code
backwards as I am creating my listview control and adding
column names dynamically. My problem of missing column
names is still there, but I need to spend more time on
this issue. I would be updating this post with my
investigation on Monday (10th Nov).

I thank you for your input.

Regards

Vinay
The sample code I posted previously created a listview with 400columns. It is working fine on my Windows XP machine, all columnheader captions are showing up as expected.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #7
* "Vinay" <cu****@cursor.com> scripsit:
I tried your sample code and it is creating 400 columns.

With this new input, I have started to track my code
backwards as I am creating my listview control and adding
column names dynamically. My problem of missing column
names is still there, but I need to spend more time on
this issue. I would be updating this post with my
investigation on Monday (10th Nov).


OK, I'll mark it as "important".

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Hi Herfried,

I am able to debug this issue. The column width parameter
in the following statement is creating problem:

Me.ListView1.Columns.Add("Column " & i.ToString(), 90,
HorizontalAlignment.Left)

Your sample code had 10 as width whereas I was using 90.
If I replace 10 with 90 in your code, I find the column
names are blank after Column364 or so.

In my present issue I have reduced the column size to 50
as a workaround, but would welcome your feedback.

BTW 9th Nov being Sunday, I didn't want to spend too much
time on this issue :=)

Regards

Vinay

OK, I'll mark it as "important".

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #9
Hi Vinay,

Thank you for your feedback. I have reported the issue.
I think this is by design about win32 control.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #10
* "Vinay" <cu****@cursor.com> scripsit:
I am able to debug this issue. The column width parameter
in the following statement is creating problem:

Me.ListView1.Columns.Add("Column " & i.ToString(), 90,
HorizontalAlignment.Left)

Your sample code had 10 as width whereas I was using 90.
If I replace 10 with 90 in your code, I find the column
names are blank after Column364 or so.

In my present issue I have reduced the column size to 50
as a workaround, but would welcome your feedback.

BTW 9th Nov being Sunday, I didn't want to spend too much
time on this issue :=)


Maybe it has something to do with the position calculation: 90 * 400 =
36,000, that's more than you can store in an 'Int16'. 362 * 90 can be
stored in an 'Int16'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #11

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

Similar topics

0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
0
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this...
4
by: Ira Siyal | last post by:
Hi I had a project in VB6 which I upgraded to VB.NET recently. In the app, I am facing some issue with listview control. In the earlier app, I have set the Icons in listview through an...
0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
6
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is...
9
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call...
2
by: =?Utf-8?B?SXJmYW4=?= | last post by:
Hello, It may be a repeated question but I don't find the solution to the situation that I encounter in it. My application is monitoring another application that is built in VB6. The...
5
by: Mark Olbert | last post by:
How do I get the DataPager and ListView to play nice together when I use a custom datasource? In my webpage, I use linq to pull data from a SqlServer database and assign the resulting...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
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
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,...
0
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...
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
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...

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.