CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Location
    USA
    Posts
    101

    formatting Listview

    I am using Listview control to display the data from my database. I am using columnheaders property to display column headers:

    ListView1.ColumnHeaders.Add , , "Count", ListView1.Width / 4

    But I am not seing the colmn headers when i RUN the program. Also the data is displayed in an irregular fashion.

    Can someone let me know why?

    Please


  2. #2
    Guest

    Re: formatting Listview

    Try this code for the column Header
    You also need to make sure that the hideColumnHeaders Property is = False,
    You can do this either at runtime or design time


    Dim colhead as ColumnHeader


    set colhead = ListView1.ColumnHeaders.Add()
    colhead.Text = "Count"
    colhead.Width = ListView1.Width / 4





    for the irregular data, what is specifically happening?






  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: formatting Listview

    It sounds like you haven't got the ListView 'view' property set to lvwReport - try this code where you add the column headers :


    With ListView1
    .View = lvwReport
    .ColumnHeaders.Add , , "Column 1"
    .ColumnHeaders.Add , , "Column 2"
    .ColumnHeaders.Add , , "Column 3"
    '
    ' etc
    '
    End With







    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured