I am trying to populate a listview and I can not see the column headers, is
there a property I am forgetting to set?
Here is my code
// Create three items and three sets of subitems for each item.
ListViewItem item1 = new ListViewItem("item1",0);
// Place a check mark next to the item.
item1.Checked = true;
item1.SubItems.Add("1");
item1.SubItems.Add("2");
item1.SubItems.Add("3");
ListViewItem item2 = new ListViewItem("item2",1);
item2.SubItems.Add("4");
item2.SubItems.Add("5");
item2.SubItems.Add("6");
ListViewItem item3 = new ListViewItem("item3",0);
// Place a check mark next to the item.
item3.Checked = true;
item3.SubItems.Add("7");
item3.SubItems.Add("8");
item3.SubItems.Add("9");
// Create columns for the items and subitems.
listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);
//Add the items to the ListView.
listView1.Items.AddRange(new ListViewItem[]{item1,item2,item3}); 2 9264
Did you set the "View" property of the ListView to "Details" instead of the default "Large Icon"?
-Mark Schmidt
----------------------------------------------------------------------?
nntp://msnews.microsoft.com/microsoft.public.dotnet.languages.csharp/
I am trying to populate a listview and I can not see the column headers, is
there a property I am forgetting to set?
Here is my code
// Create three items and three sets of subitems for each item.
ListViewItem item1 = new ListViewItem("item1",0);
// Place a check mark next to the item.
item1.Checked = true;
item1.SubItems.Add("1");
item1.SubItems.Add("2");
item1.SubItems.Add("3");
ListViewItem item2 = new ListViewItem("item2",1);
item2.SubItems.Add("4");
item2.SubItems.Add("5");
item2.SubItems.Add("6");
ListViewItem item3 = new ListViewItem("item3",0);
// Place a check mark next to the item.
item3.Checked = true;
item3.SubItems.Add("7");
item3.SubItems.Add("8");
item3.SubItems.Add("9");
// Create columns for the items and subitems.
listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);
//Add the items to the ListView.
listView1.Items.AddRange(new ListViewItem[]{item1,item2,item3});
When I change it to List I get the Item level, but when I set it to
details I see nothing.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yaron |
last post by:
Hi
I'm creating a control very similar to the ListView in Details mode. I'm confused as to how to go about drawing the column headers at the top
As the column headers are static and stay in one...
|
by: MFRASER |
last post by:
I am trying to populate a listview and I can not see the column headers, is
there a property I am forgetting to set?
Here is my code
// Create three items and three sets of subitems for each...
|
by: Per Rollvang |
last post by:
Hi All!
I use a special ListViewItemComparer-class to sort items in a listview for
any column, and I have also allowed column-reordering.
So far so good, but if I click the columnheader of any...
|
by: Abhishek Bagga |
last post by:
I want to insert Image in the column headers of the Listview control
I have been trying this but was unable to achieve it.
Is it possible? if yes kindly guide me how to achieve this.
--
-...
|
by: Danny Tuppeny |
last post by:
Hi all,
I need to build a Treeview/Listview control (none of those on codeproject do
quite what I need!), and was considering using one of the existing controls
as a starting point, though now...
|
by: Owen T. Soroke |
last post by:
Using VB.NET
I have a ListView with several columns.
Two columns contain integer values, while the remaining contain string
values.
I am confused as to how I would provide functionality to...
|
by: J L |
last post by:
Is it possible to create multi-line column headers for the listview
control? If so, how?
TIA,
John
|
by: JL |
last post by:
Is it possible and if so, how, to change the color (and/or font) of a
listveiw's column headers at runtime and individually?
TIA,
John
|
by: erik.alsmyr |
last post by:
When setting the Scrollable property of a listview and resizeing it the
headers will be painted wrongly. This defect is documented in MSDN as:
In versions of the .NET Framework prior to version...
|
by: =?Utf-8?B?LnBhdWwu?= |
last post by:
how do i change the color of the text in the fixedrow (column headers) of a
listview?
thanks
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
| |