RE: Too Many ListView Columns

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi Greg,

ListView is a more advanced control than ListBox. A key difference is the
ListView has four different display mode. This can be set in the
ListView.View property in designer. The default value is View.LargeIcon,
which displays the items from left to right in the same row and will
display in the second row when the first row is full. I think this is the
behavior you see in your program. The detailed behavior of different
display mode is documented below:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.view.aspx

To display the ListView like the ListBox, you should change the
ListView.View property to View.Details. This will show each item in a row.
Note: View.Details enables the columns for the subitems, so you should also
add several columns in ListView.Columns property in designer. Then, your
items and subitems will map to each column you added in the
ListView.Columns property.

For a sample regarding using ListView in details mode, please refer to the
article below:
"Working with ListView"
http://www.ondotnet.com/pub/a/dotnet/2002/10/28/listview.html

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: ListView Grid Line Issue
    ... grid line issue you described is a known problem of ListView in .NET2.0. ... this problem doesn't exist on Windows 2003. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: Selecting a ListViewItem!
    ... I add a ListView and a TextBox and a Button on a form. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • Re: ListView wont show items on x64?
    ... making some unusual API calls against the ListView in my project which I ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.dotnet.framework)
  • RE: ListViewItem not showing correct Formatting
    ... Is the GUIData_ListItem a custom class you have created in your project? ... I write some code to add some ListViewItems into the ListView in the Form's ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: ListView in VirtualMode
    ... I performed a test based on your description but I didn't reproduce the ... I set up a Windows application project and drag&drop a ListView from ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)