PC Review


Reply
Thread Tools Rate Thread

How can I hide individual images in a DataGridViewImageColumn

 
 
Quick
Guest
Posts: n/a
 
      13th Dec 2006
I have a DataGridView that has a DataGridViewImageColumn.

The image that renders in the column needs to only be visible when a
certain value is present within another column in the DataGridView.

I can't seem to figure out what it would take to make this happen.
Just about every property I can find to use on the individual cell that
deals with display is Read Only.

Here's what I've got so far:

foreach (DataGridViewRow row in dgEmployees.Rows) {
if (row.Cells[15].Value.ToString().Trim() == "") {
row.Cells[3]. ((remove/hide the image in this cell of the
current row))
}
}

I can't imagine this is an uncommon thing to do, so I'm figuring I'm
just overlooking something simple or I'm going about it the wrong way.

Any ideas would be greatly appreciated.

-Quick

 
Reply With Quote
 
 
 
 
Quick
Guest
Posts: n/a
 
      13th Dec 2006
I got it. Yeah I was going about it the wrong way.

((DataGridViewImageCell)row.Cells[3]).Value = new Bitmap(1, 1);

Casting the current cell as a DataGridViewImageCell then changing its
value to a blank Bitmap object seemed to work. Although if anyone has
a better way of accomplishing this I'd like to see it as well.

-Quick

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
e-mail to a group, but hide individual names Ladyccc Microsoft Outlook Discussion 1 16th Dec 2008 08:41 PM
Displaying images in bound DataGridViewImageColumn -- why it needs to be so complicated? StanB Microsoft Dot NET Framework Forms 0 10th May 2007 09:56 PM
DataGridViewImageColumn and pictures from files... Kevin Microsoft VB .NET 0 4th Feb 2007 01:39 AM
can I hide the individual names of a distribution list in an e mai =?Utf-8?B?d21lbGV5Y28=?= Microsoft Outlook Discussion 1 29th Jan 2006 12:02 AM
how do I hide individual contacts in groups? =?Utf-8?B?c2xzOTA1?= Microsoft Outlook Contacts 3 8th Dec 2004 02:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:37 PM.