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. Showing an icon in a gridview (WPF)

Showing an icon in a gridview (WPF)

Scheduled Pinned Locked Moved C#
csharpwpfquestion
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
    Johan Lombaard
    wrote on last edited by
    #1

    I need to display icons next to items in a listview (using gridview) with WPF. Does anyone have a sample of this ?

    Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein

    K 1 Reply Last reply
    0
    • J Johan Lombaard

      I need to display icons next to items in a listview (using gridview) with WPF. Does anyone have a sample of this ?

      Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      Normally I would suggest using an asp:Image control, but I am not sure if the ImageUrl support Icon files. Why wouldn't you use gif or jpg files instead? Anyway, it might work with icon files. First create a new column that is a template column in your gridview. Once you have a template column you have an ItemTemplate and an EditTemplate. Create an asp:Image control in the itemtemplate and bind it to the correct variable that has the imageurl in it. If you allow editing to your grid view you will need to add it there as well if you want the image to be seen when editing. Hope that helps. Ben

      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