Solved

Listview with gridlines and groups

Posted on 2014-03-05
6
475 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
  • 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This video teaches viewers about errors in exception handling.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now