Solved

color a single cell in a listview (vb.net)

Posted on 2011-02-19
8
1,923 Views
Last Modified: 2012-05-11
Hello,

I'm trying to make a listview looking like this:

 Listview individual cell colors
Can someone provide me an example code that can color the individual cells of a listview

grtz

Jeroen
0
Comment
Question by:HertelDra
  • 4
  • 2
  • 2
8 Comments
 
LVL 11

Expert Comment

by:Deepak Lakkad
ID: 34933370
hi

Is it a WinForm application or what?

- Deepak Lakkad
0
 

Author Comment

by:HertelDra
ID: 34933421

yes it is.

0
 
LVL 11

Expert Comment

by:Deepak Lakkad
ID: 34933451
Hi

I think this will not be possible in ListView

My suggestion is use DataGridView if you are binding it with database


- Deepak Lakkad
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34933464
How are you binding ListView ?
- Is it from database (ListView.DataSource = ds) OR
- Creating at runtime ?
0
 

Author Comment

by:HertelDra
ID: 34933471
it is created during runtime
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34933650
It seems that not possible in ListView. I tried and research for sometime.
Here is the alternative way...
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_26649866.html?sfQueryTermInfo=1+10+30+background+cell+chang+color+listview
0
 

Accepted Solution

by:
HertelDra earned 0 total points
ID: 34946474
Hey guys thanks for your help.

I've found the solution by setting the "ownerdraw" setting to true.

This is what i have found:
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.ownerdraw.aspx
0
 

Author Closing Comment

by:HertelDra
ID: 34986550
This was what worked eventually
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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