Results 1 to 4 of 4

Thread: Datagridview image formatting

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Datagridview image formatting

    Quick formatting question: My datagridview's image columns display the broken-image picture if there's no image. How can I make them just display nothing instead?
    Last edited by colleen.boye; Jun 18th, 2013 at 06:59 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Datagridview image formatting

    This is a bit of an educated guess but I think that you'll need to set the DefaultCellStyle.NullValue property of the column to Nothing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: Datagridview image formatting

    No dice; that only seems to change the null value of text cells.

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Datagridview image formatting

    She cannae take it Cap'n!

    There has to be a picture there of some sort. If you don't supply one then it's the red X. I suppose you could create an image that's all white (or whatever your background colour is)!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width