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. ListView

ListView

Scheduled Pinned Locked Moved C#
wpfwcfquestion
5 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.
  • B Offline
    B Offline
    Bahadir Cambel
    wrote on last edited by
    #1

    Hi , I am trying to liken the ListView to a dataGrid.. Lets say we have a dataTable and a ListView.. In order to simulate dataGrid , we would like to known how many colums do we have , before binding the items into the ListView , I create the columns... for ( int j =0 ;j Then , I consider to bind each dataRow into the ListView with the corresponding columns.. `for ( int i = 0 ; i Do you have any idea what I am doing wrong ?`

    C 1 Reply Last reply
    0
    • B Bahadir Cambel

      Hi , I am trying to liken the ListView to a dataGrid.. Lets say we have a dataTable and a ListView.. In order to simulate dataGrid , we would like to known how many colums do we have , before binding the items into the ListView , I create the columns... for ( int j =0 ;j Then , I consider to bind each dataRow into the ListView with the corresponding columns.. `for ( int i = 0 ; i Do you have any idea what I am doing wrong ?`

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You're adding the column name over and over again ? It would help if you said what is actually GOING wrong. Why are you using a listview if you want a datagrid ? Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      B 1 Reply Last reply
      0
      • C Christian Graus

        You're adding the column name over and over again ? It would help if you said what is actually GOING wrong. Why are you using a listview if you want a datagrid ? Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        B Offline
        B Offline
        Bahadir Cambel
        wrote on last edited by
        #3

        Thanks for the reply , May be because of the style of the text , you cant see right , I only add the columns to the listView in the first loop, then I add values to those columns.. well it seems like , the values are ok , by this code..But I guess , I made the ListView nervous , treating like a dataGrid.May be you are right, I was just looking for fun , and develop some UI skills...:laugh: StringBuilder s = new StringBuilder(); foreach (ListViewItem li in this.listView1.Items) { s.Append(li.Text); for(int k =0;k

        B 1 Reply Last reply
        0
        • B Bahadir Cambel

          Thanks for the reply , May be because of the style of the text , you cant see right , I only add the columns to the listView in the first loop, then I add values to those columns.. well it seems like , the values are ok , by this code..But I guess , I made the ListView nervous , treating like a dataGrid.May be you are right, I was just looking for fun , and develop some UI skills...:laugh: StringBuilder s = new StringBuilder(); foreach (ListViewItem li in this.listView1.Items) { s.Append(li.Text); for(int k =0;k

          B Offline
          B Offline
          Bahadir Cambel
          wrote on last edited by
          #4

          ok , At last I found the reason, ColumnHeader Collection can not be work with listView(or I cant do it) ColumnHeader [] h = new ColumnHeader[ColumnCount]; for (int i=0;i After I declare ColumnHeader one by one , it works fine.. Do you see any syntax or algorithm errors in Column Header Collection that I created?

          R 1 Reply Last reply
          0
          • B Bahadir Cambel

            ok , At last I found the reason, ColumnHeader Collection can not be work with listView(or I cant do it) ColumnHeader [] h = new ColumnHeader[ColumnCount]; for (int i=0;i After I declare ColumnHeader one by one , it works fine.. Do you see any syntax or algorithm errors in Column Header Collection that I created?

            R Offline
            R Offline
            Rob Graham
            wrote on last edited by
            #5

            it's not a collection, its an array as you have created it using array syntax. Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed. Carl Sandburg

            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