Results 1 to 3 of 3

Thread: [2005] Datagridview image Column

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Question [2005] Datagridview image Column

    I’ve got a datagridview with an image column, when there is no image to display the default is the little red cross.

    How do I set the datagrid to not show anything in an image column if there is no image to display?
    How do I get it to be blank instead of showing the broken image red X?

    The Help text has useless, I’ve tried setting DataGridView1.DefaultCellStyle.NullValue = DBNull.value but it didn’t work.

  2. #2
    Addicted Member
    Join Date
    Mar 2008
    Posts
    143

    Re: [2005] Datagridview image Column

    Create a blank image and use that in rows where you have no image?
    Shut up and eat your banana!

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: [2005] Datagridview image Column

    Um, what does the Help have to do to be of use, come over to your house and iron your shirts? The documentation for the DataGridViewImageColumn class says this:
    By default, empty cells display a default error graphic. To prevent this graphic from appearing for cell values equal to a null reference (Nothing in Visual Basic) or DBNull.Value, set the DataGridViewCellStyle.NullValue property of the cell style object returned by the DefaultCellStyle property to a null reference (Nothing in Visual Basic) before adding rows to the control.
    That means for the column, not the grid.

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