Solved

Listview with gridlines and groups

Posted on 2014-03-05
6
496 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

815 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

8 Experts available now in Live!

Get 1:1 Help Now