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. Windows Forms
  4. How to show image in ListView Second Column **** urgent

How to show image in ListView Second Column **** urgent

Scheduled Pinned Locked Moved Windows Forms
csharpwinformshelptutorialquestion
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.
  • V Offline
    V Offline
    VenkataRamana Gali
    wrote on last edited by
    #1

    Hello, i am working on C# 2.0 winforms. I have a ListView, in this there are 5 columns, in second column an icon need to be displayed. my code as follows... listView1.Columns.Add(""); listView1.Columns.Add(""); listView1.Columns.Add("two"); listView1.Columns.Add("three"); listView1.Columns.Add("one"); listView1.Columns.Add("two"); listView1.Columns.Add("three"); listView1.FullRowSelect = true; listView1.GridLines = true; listView1.View = View.Details; listView1.SmallImageList = imageList1; //imageList1 is having 1 icon. for (int I = 0; I <= 10; I++) { ListViewItem item = new ListViewItem(""); item.SubItems.Add(""); item.SubItems.Add("aaa"); item.SubItems.Add("bbb"); item.SubItems.Add("cccc"); item.ImageIndex = 0; //this code showing image in first column listView1.Items.Add(item); } my problem is... item.ImageIndex = 0; is showing icon in only first column. i have to show icon in second column. how to to do? any sounds will be greatly appriciated.

    Ramana

    S 1 Reply Last reply
    0
    • V VenkataRamana Gali

      Hello, i am working on C# 2.0 winforms. I have a ListView, in this there are 5 columns, in second column an icon need to be displayed. my code as follows... listView1.Columns.Add(""); listView1.Columns.Add(""); listView1.Columns.Add("two"); listView1.Columns.Add("three"); listView1.Columns.Add("one"); listView1.Columns.Add("two"); listView1.Columns.Add("three"); listView1.FullRowSelect = true; listView1.GridLines = true; listView1.View = View.Details; listView1.SmallImageList = imageList1; //imageList1 is having 1 icon. for (int I = 0; I <= 10; I++) { ListViewItem item = new ListViewItem(""); item.SubItems.Add(""); item.SubItems.Add("aaa"); item.SubItems.Add("bbb"); item.SubItems.Add("cccc"); item.ImageIndex = 0; //this code showing image in first column listView1.Items.Add(item); } my problem is... item.ImageIndex = 0; is showing icon in only first column. i have to show icon in second column. how to to do? any sounds will be greatly appriciated.

      Ramana

      S Offline
      S Offline
      Sangmeshwar patil
      wrote on last edited by
      #2

      Hi All, Even I am also having same requirement. Please let me know is it possible to display icon in second colunm? otherwise I will make use of datagrid.. -Sangmeshwar Patil

      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