473,804 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Columns in a ListView

Hope someone can help me with a question about this control.

I would like to display a list of file names, together with a
description for each file. I've done some prototyping, and the ListView
seems ideal, at least as far as the presentation of the static
inforamation is concerned.

However:

* the Item is logically the filename (that's akin to the primary key
in my list);
* so the filename should appear leftmost, but not be editable;
* the description text is currently a SubItem (it's an attribute of
the file);
* so the description should appear on the right - but I need it to be
editable.

There are many ways to allow a SubItem to be edited indirectly, but it
would be great if I could arrange it to be editable in situ.

I think that only the Item can be edited, which means that the
description would have to become Item. But I'd really want the filename
to remain in the left column.

So I'd like to be able to have the order of columns going SubItem[0],
Item, or something like that.

Here's an illustration:

File Description
=============== =========
myFile1 | something
myFile2 | something else

- and I'd want users to be able to edit it to read:

File Description
=============== =========
myFile1 | summat
myFile2 | quelque chose

Is this feasible with the ListView control?

Many thanks for any replies!

Ron

Nov 17 '05 #1
4 1383
Sugnaboris,

Why take this difficult approach. Even the Item in a listview is not the
nicest to Edit.

Why not just take a datagrid with a datatable, that you can customize in my
opinion completly in the way as you ask it.

Just my thought,

Cor
Nov 17 '05 #2
I should probably have indicated that I need some help, when posting
the original. I'm still stuck, and any advice would be great.

sugnabo...@gmai l.com wrote:
Hope someone can help me with a question about this control.

I would like to display a list of file names, together with a
description for each file. I've done some prototyping, and the ListView seems ideal, at least as far as the presentation of the static
inforamation is concerned.

However:

* the Item is logically the filename (that's akin to the primary key
in my list);
* so the filename should appear leftmost, but not be editable;
* the description text is currently a SubItem (it's an attribute of
the file);
* so the description should appear on the right - but I need it to be editable.

There are many ways to allow a SubItem to be edited indirectly, but it would be great if I could arrange it to be editable in situ.

I think that only the Item can be edited, which means that the
description would have to become Item. But I'd really want the filename to remain in the left column.

So I'd like to be able to have the order of columns going SubItem[0],
Item, or something like that.

Here's an illustration:

File Description
=============== =========
myFile1 | something
myFile2 | something else

- and I'd want users to be able to edit it to read:

File Description
=============== =========
myFile1 | summat
myFile2 | quelque chose

Is this feasible with the ListView control?

Many thanks for any replies!

Ron


Nov 17 '05 #3
Thanks, Cor.

I have looked at some alternatives, and am not absolutely determined to
stick with a ListView - it just happens to be "just about" what I want,
so I wanted to know if there was any way of using it to do this.

While I wait for other reponses about the ListView approach, I'll knock
up another prototype with the method you suggest.

Nov 17 '05 #4
In article <11************ *********@z14g2 000cwz.googlegr oups.com>,
wrote:
I should probably have indicated that I need some help, when posting
the original. I'm still stuck, and any advice would be great.

Try looking at
http://www.codeproject.com/cs/miscct...edControls.asp

Mike

Nov 17 '05 #5

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

Similar topics

0
2566
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via ListView.Columns.RemoveAt() then the ListView still displays fine. However, if I grab a subitem value via listView.Items.SubItems.Text Then I get the Text of the wrong column.
3
3296
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the ListView, and the item would automatically have the correct number of subitems, which I could access using array syntax. That doesn't seem to be the case in VB .Net. I tried creating a two-column listview. I added an item, and then tried to set the...
0
1146
by: CR | last post by:
I'm having a problem with the Listview control. I populated a Listview with 4 columns. On my PC they show up just fine, the right hand edge of the 4th column lines up with the right hand edge of the Listview control. However when I tried to run it on another PC you could only see 3 columns in the Listview, you have to scroll to see the 4th. I figured out it was because I had my screen property set to large fonts (Control...
3
4271
by: simchajoy2000 | last post by:
Hi, I am trying to use a VB.NET listview object to display information from a datatable. I need to have two columns of information but I don't want the user to be able to select each column individually - that's why I am attempting to use a listview rather than a datagrid. I have been reading a lot of postings in this newsgroup concerning multiple columns in listviews and I have tried to follow all the advice I have found - but I am...
5
25972
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear() Listview.View = View.Details
0
9572
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
10562
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
10319
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
10303
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,...
1
7608
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
6845
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.