• Creator
    Topic
  • #4094
    Anonymous

      hi There!

      Can anyone tell me how to add items and subitems to a TRzListview?

      I tried several combinations but without any luck so far.

      Thanks.

    • Author
      Replies
    • #7079
      Support 1
      Participant

        Peter,

        Thank you for your enquiry.

        If you want ListView subitems to be visible, be sure to set the property ViewStyle to vsReport. The following is a simple code example to populate a TRzListView…

        Sub Main(Client, GWEvent)
        
          dim I
          dim iFruit, iFruits
          dim oItem
        
          ' Initialize a 2-dimensional array of data.
          iFruits = Array(Array("Apple", "July-Oct"), _
            Array("Cherry", "May-June"), _
            Array("Fig", "July-Sep"), _
            Array("Kiwifruit", "Oct-May"))
        
          ' This assumes a form MainForm with TRzListView named
          ' ListView which has two columns defined.
          with MainForm.ListView
            .Column(0).Caption = "Fruit"
            .Column(1).Caption = "Months in season"
            .Items.BeginUpdate
            .Items.Clear
            for I = 0 to UBound(iFruits)
              iFruit = iFruits(I)
              set oItem = .Items.Add
              oItem.Caption = iFruit(0)
              oItem.SubItems.Add(iFruit(1))
            next
            .Items.EndUpdate
          end with
          MainForm.ShowModal
        
        End Sub

        I hope this helps you.

        Advansys Support

        #7080
        Anonymous

          Thanks!

          I’ll just try that!

          #7078
          Support 1a
          Participant

            No problems. Please let us know if you require any further assistance.

            Regards,

            Advansys Support

          Viewing 3 replies - 1 through 3 (of 3 total)
          • You must be logged in to reply to this topic.