none
CListCtrl: Columns do not resize, if more number of columns are added

    Question

  • I have a ClistView class, I am adding too many columns 300+. At some point, the last few columns cannot be resized.

    Is there a restriction on the number of columns or something to do with pixel sizes allowed?

    Any help will be great.

    Thanks,

    Saleem


    Tuesday, August 27, 2013 11:29 AM

Answers

  • I would suggest making your view a "virtual" one in this case. It is common to make a virtual view of many rows so it would seem you also need one of many columns. There is little value in storing all the data not visible to the user (I suspect 300 columns are not visible on the screen) in the list view. Better to load only the visible data and as you scroll left/right load more data into the cache/control.

    Have you considered replacing the CListView with a more sophisticated Grid control?

    MSDN: How to use virtual ListView controls

    Thursday, August 29, 2013 9:12 AM

All replies

  • There is an "restriction", since this issue was also reported 1 or 2 years ago. I also tried to reproduce this and at some point I did not saw the added columns.

    My advice would be creating a small example and reporting this @Connect.


    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

    Tuesday, August 27, 2013 12:44 PM
  • My question is do you really need 300 column . You should reconsider your design .

    Thanks


    Rupesh Shukla

    Tuesday, August 27, 2013 4:40 PM
  • In our design, the end users can add columns. So they have added around 300+ columns.

    We do not want to change that.

    Thanks for your reply.

    Saleem

    Wednesday, August 28, 2013 7:13 AM
  • Thanks for your reply.

    I am sorry, but what is @Connect.

    Saleem

    Wednesday, August 28, 2013 7:18 AM
  • First thing using  an application with 300+ column i am not sure what will be the performance of your system . where are you storing all the data . It's good if you have some sub list control . What i mean one control show all the value and list now when you click on that next control update the property with respect to first selection . if i want to see the value of 244 column and started moving first and showhow my mouse or selection went to some other item it is hard to find out which one is 244 or 278.  Second is there any way you can show 300 column at a same time of machine in aredable form.

    Thanks


    Rupesh Shukla

    Wednesday, August 28, 2013 2:11 PM
  • I am sorry, but what is @Connect.

    Connect is the MS "bug tracking system": https://connect.microsoft.com/

    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

    Thursday, August 29, 2013 4:59 AM
  • I would suggest making your view a "virtual" one in this case. It is common to make a virtual view of many rows so it would seem you also need one of many columns. There is little value in storing all the data not visible to the user (I suspect 300 columns are not visible on the screen) in the list view. Better to load only the visible data and as you scroll left/right load more data into the cache/control.

    Have you considered replacing the CListView with a more sophisticated Grid control?

    MSDN: How to use virtual ListView controls

    Thursday, August 29, 2013 9:12 AM