Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. pictures in a datagrid

pictures in a datagrid

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    troels_sorensen
    wrote on last edited by
    #1

    How can I in my winform display picture or icons in one of the columns in my datagrid?

    H 1 Reply Last reply
    0
    • T troels_sorensen

      How can I in my winform display picture or icons in one of the columns in my datagrid?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      By writing your own DataGridColumnStyle class. There are many examples out there that describe hosting a ComboBox in a DataGridColumnStyle, and these wouldn't be hard to adapt and use a PictureBox instead. If you want, you wouldn't even have to worry about the editing if you want this image to be read-only (the editing is the most difficult part). Just make sure your query returns a BLOB (which you can read into a Stream, like a MemoryStream) or a path to an image. For a good example of hosting a ComboBox in a DataGridColumnStyle, see http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/[^]. It includes examples and sample source.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups