Solved

Listview with gridlines and groups

Posted on 2014-03-05
6
528 Views
Last Modified: 2014-03-05
Experts, I am using a listview on my form. I have it set to use gridlines. In design view the gridlines are there. But as the list is populated it creates groups in the listview to sort the items. When the groups are added the gridlines disappear. Is this just the way it works or is there something else i can do to show the gridlines with groups?
0
Comment
Question by:Basicfarmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39907147
Search around net suggests that its a well known limitation but I have not been able to find any solution.
0
 

Author Comment

by:Basicfarmer
ID: 39907572
I did not get that it was well know but i have done quite a bit of searching for it and people continue to suggest making sure that gridlines is set to TRUE.
0
 

Author Closing Comment

by:Basicfarmer
ID: 39907599
I give up. I cannot find anything definitively saying it does not work, but cannot find a solution either.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39907605
Have you looked into the OwnerDraw property? If you set it to True and hook up some events like this for example
    Private Sub ListView1_DrawSubItem(sender As Object, e As System.Windows.Forms.DrawListViewSubItemEventArgs) Handles ListView1.DrawSubItem
        With e.Graphics
            .DrawLines(New Pen(SystemColors.ButtonFace), New Point() {New Point(e.Bounds.Left, e.Bounds.Top - 1), New Point(e.Bounds.Left + e.Bounds.Width, e.Bounds.Top - 1), New Point(e.Bounds.Left + e.Bounds.Width, e.Bounds.Top + e.Bounds.Height), New Point(e.Bounds.Left, e.Bounds.Top + e.Bounds.Height)})
        End With
        e.DrawText()
    End Sub

    Private Sub ListView1_DrawColumnHeader(sender As Object, e As System.Windows.Forms.DrawListViewColumnHeaderEventArgs) Handles ListView1.DrawColumnHeader
        e.DrawDefault = True
    End Sub

Open in new window

it seems to come close to what you need.
capture
0
 

Author Comment

by:Basicfarmer
ID: 39907617
Robert, I am sorry that i gave up too soon and already posted points to another member. Thank you for posting this I will follow this lead...
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39907637
No problem, see if you can get it to work for you and if so, we talk business ;-)
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question