Using ListView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnasarma
    New Member
    • Jun 2007
    • 22

    Using ListView

    I have three columns. How to add the data's row by row fashion.
    Thanks in advance
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by krishnasarma
    I have three columns. How to add the data's row by row fashion.
    Thanks in advance
    corruption it's not "Data's". But it is "Data".

    and you have to post what is your front-end versions?

    Comment

    • krishnasarma
      New Member
      • Jun 2007
      • 22

      #3
      Ya how to add data in row by row fashion in listview . My frontend version is vb6

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by krishnasarma
        Ya how to add data in row by row fashion in listview . My frontend version is vb6
        [CODE=vb]Dim lsItem As ListItem

        <for loop>
        ' am not sure about the AddItem perameters because i am gussing.
        set lsItem = lvListViewName. AddItem(intInde xValue, Col0ValueToShow )
        lsItem.SubItem( 1) = Col1ValueToShow
        lsItem.SubItem( 1) = Col2ValueToShow
        lsItem.SubItem( 1) = Col3ValueToShow
        <next>[/CODE]
        if you get the concept you can do.

        (Code not tested).

        Comment

        • slapshock
          New Member
          • Oct 2006
          • 57

          #5
          dim c as integer
          c=1
          do

          loop while c<= listview1.listi tems.count

          Comment

          • slapshock
            New Member
            • Oct 2006
            • 57

            #6
            [CODE=vb]Dim c As Integer
            Dim i As Integer
            c = 1
            For i = 0 To 5
            listview1.ListI tems.Add(c) = "sample data"
            Next i[/CODE]

            Try this code, hope it can help.
            Last edited by Killer42; Aug 24 '07, 06:25 AM. Reason: Added CODE=vb tag

            Comment

            • pureenhanoi
              New Member
              • Mar 2007
              • 175

              #7
              Originally posted by krishnasarma
              I have three columns. How to add the data's row by row fashion.
              Thanks in advance
              If you've loaded data into Recordset, so, do like this
              [CODE=VB]
              Dim Rs as Recordset
              Dim lvItem as ListItem
              'load data into Rs
              While Not Rs.EOF
              Set lvItem = ListView1.ListI tems.Add(,,rs!f ield1)
              lvItem.SubItem( 1) = rs!field2
              lvItem.SubItem( 3) = rs!field3
              Rs.MoveNext
              Wend
              [/CODE]
              Remember, add enought column for the Listview at design time.

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by krishnasarma
                I have three columns. How to add the data's row by row fashion.
                Thanks in advance

                Go through This Article

                Comment

                Working...