Solved

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

Posted on 2011-02-19
8
1,951 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
[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
  • 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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 
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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

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 …
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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