Results 1 to 3 of 3

Thread: Add Listview group thru code

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Add Listview group thru code

    Dear All,

    How to add listview group thru code? .. I am trying codes below.. but nothing appear on my lv (listview)..

    Code:
     while (dr.Read())
    {
        string groupname = dr.GetString(dr.GetOrdinal("groupname"));
        lv.Groups.Add(new ListViewGroup(groupname, HorizontalAlignment.Center));
    }
    could anybody please help?

    Thanks & Regards

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Add Listview group thru code

    Do you have the ShowGroups property set to true?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Re: Add Listview group thru code

    yes, ShowGroups property is True by default..

    any idea?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width