CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2003
    Location
    Plano, TX
    Posts
    4

    Question How to Display 2 lines of text in ListView Item

    Hi All,

    Is there a way to display two lines/rows of text within a single ListView Item? I have searched the web, newsgroups and MSDN to no avail. To get around this I have kludged together a composite control (using a panel, 2 rows of labels, and a picturebox) that simulates a two-line row of data. However, now that I have resolved *this* issue, I find that my challenge has morphed into building a scrollable container into which this composite control can be embedded. So, before I pour more effort into this approach, I thought I should at least ask if there is a way to do this directly, or indirectly, with a ListView. BTW, I need to do this with the .NET Compact Framework, but any thoughts are appreciated. Thx.

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    i don't think in listview this is possible directly, so you need to trick out the GUI part as you are doing something right now.

    Paresh

  3. #3
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    forgot to mention that instead of listview you could use datagrid so that it could help you in all purposes that you want. you could overload the class when its editting mode. there are samples in MSDN check out.

    paresh

  4. #4
    Join Date
    Jan 2003
    Location
    Plano, TX
    Posts
    4
    Thanks Paresh. I will check out the datagrid - if the individual cells can contain and display objects other than text, then maybe I could insert my composite control (panel with picbox, labels, etc.). This would accomplish what I am trying to do. I'll post the result of my inquiry.

  5. #5
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    did you got the solution or still doing. Datagrid should be usefull to u.

    if u want i can send samples to u..


    Paresh

  6. #6
    Join Date
    Jan 2003
    Location
    Plano, TX
    Posts
    4
    Paresh, I checked into using the Grid control. What I found is that in the .NET Compact framework, the grid elements can only contain text, so this appears to preclude the Grid control for my application. I may be wrong in my conclusion though, so I would appreciate any code samples or additional thoughts you might have on the subject. Thx for the help.

    Donovan.

  7. #7
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    I have not tested DataGrid on Compact framework of .NET but however if you wish to explore more then you could try overriding DataGrid etc.. here is the website like that will help you in that case

    DataGrid Link

    thanx
    Paresh

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