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. Web Development
  3. ASP.NET
  4. ASP.Net Datagrid and thumbnails

ASP.Net Datagrid and thumbnails

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-nethelptutorial
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.
  • J Offline
    J Offline
    j1webb
    wrote on last edited by
    #1

    I need to fill a datagrid with data and images. There will be some data in about 4 columns and then 1 thumbnail in one column on each row. I am reading a MS SQL DB that has the description, mfg, owner and path/name to the jpg image for that item. What I need to do is convert the images to thumbnails, store them in a dataset along with the other data that will be displayed in the datagrid and then bind the DS to a datagrid. Does anyone know if this can be done. If so, can you either tell me how to do it or direct me to some info that will help me. If it can't be done this way, does anyone know how it can be done and would you share that with me.

    M 1 Reply Last reply
    0
    • J j1webb

      I need to fill a datagrid with data and images. There will be some data in about 4 columns and then 1 thumbnail in one column on each row. I am reading a MS SQL DB that has the description, mfg, owner and path/name to the jpg image for that item. What I need to do is convert the images to thumbnails, store them in a dataset along with the other data that will be displayed in the datagrid and then bind the DS to a datagrid. Does anyone know if this can be done. If so, can you either tell me how to do it or direct me to some info that will help me. If it can't be done this way, does anyone know how it can be done and would you share that with me.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, You can get the thumbnail of an image using the Image.GetThumbnailImage Method[^]. However, you don't need to create and add the thumbnail to a dataset and you can deplay it until the data is bound to the datagrid control. In an ASP.NET application, you basically use an image control to display the image, and you either set the path of the static image in the image control or use a seperate web page .aspx that is responsible for generating the image/thumbnail on the fly. So in this case, you may have two options here: + Create and save the thumbnails to disk, you only need to store of the paths of the thumbnails in the dataset, then bind it to the grid. + You only store the path of the image files, not the thumbnail, in the dataset, and use a seperate web page (or a custom http handler) to generate the thumbnails on the fly. I believe that many people asked this question in the forum, so you can search for it or you might also want to check out the site[^] for tons of the datagrid examples

      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