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. Binding data to Listview

Binding data to Listview

Scheduled Pinned Locked Moved C#
tutorialdatabasewpfwcfhelp
4 Posts 3 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
    T EDY
    wrote on last edited by
    #1

    Hi, I have a problem how to bind our database data into a listview..is it the same way we bind the data into gridview?could someone give me an example? Thank You

    S R 2 Replies Last reply
    0
    • T T EDY

      Hi, I have a problem how to bind our database data into a listview..is it the same way we bind the data into gridview?could someone give me an example? Thank You

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      What problem? Explain clearly you problem? so that only we can help you.

      Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus

      T 1 Reply Last reply
      0
      • T T EDY

        Hi, I have a problem how to bind our database data into a listview..is it the same way we bind the data into gridview?could someone give me an example? Thank You

        R Offline
        R Offline
        RepliCrux
        wrote on last edited by
        #3

        Hi, In ListView you will have to Enumerate the datasource and fill it. For example, if your datasource is a DataTable, you can write the following: foreach(DataRow row in table.Rows) { ListViewItem item = new ListViewItem(); item.Text = row["Description"].ToString(); item.Tag = row["ID"].ToString(); //For other coulmns items.SubItems.Add(row["OtherColumn"].ToString(); } Hope this helps.

        1 Reply Last reply
        0
        • S Sathesh Sakthivel

          What problem? Explain clearly you problem? so that only we can help you.

          Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus

          T Offline
          T Offline
          T EDY
          wrote on last edited by
          #4

          I'm sorry maybe my english is bad for example: I have a table name Contact in my database..and i want the data on that table to be show on a Listview..I already know how to bind it on a gridview, but i can't find a way to bind the data on a ListView..i use SQLServer 2005 Express Edition for the database Thank You:)

          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