ListViewGroup Expander?

I am trying to Create an Expander to my groups in a listview. Much like in Outlook there is an expander for if a message was sent a week a month or a day ago.

how can i do that


Answer this question

ListViewGroup Expander?

  • Alik Khavin - MSFT

    There is no good way to detect that click was made on group or to intercept group painting operation. This is what makes it hard to make an expander.

    So I think you have nothing to do but to simulate groups and expander by yourself. Do you want to use ListView or DataGridView First one have better drag-n-drop support, while second is more powerful.



  • ShaneShowers

    My Question is more of is there a way to Override the ListViewGroup to add an Expander. If you can help me with that the easier the better. however i wouldn't mind going a little out of my way for a lot more power.

  • desny

    Hi!

    Use ListView with View=Tiles and Groups, this will do most things except you do not have +/- to expand/collapse group content.

     

    Another was is to use DataGridView, but you must group and order items manually. Then intercept formatting for the "message" cells and indent them. Intercept formatting for the "group" cells and render differently (bold for example). Then intercept mouse click on "group" cells and remove/insert into data source "messages" of this "group".

    If you need samples - I can help.



  • ListViewGroup Expander?