Click to See Complete Forum and Search --> : CListCtrl adding second header


Jim Watters
May 19th, 1999, 07:24 PM
I have a CListCtrl, in report view, which contains mostly numeric data. I have a CheaderCtrl at the top describing the data. I want to add a second CheaderCtrl to the bottom that will sum up or average the rows that are selected.

I already use my own derived classes of CListCtrl and CheaderCtrl and handle the OnDraw for both.

I have the starts of two possible solutions what do you like best, and what am I missing?


1
I would like to do this inside my CListCtrl because there are several places I would like to use this. The problem is forcing the CListCtrl to scroll up far enough to show all the data. I thought of adding a empty row so it would not block valid data, but that gets complicated with allowing sorting. In OnDraw I can NOT draw the last item (in the case there are fewer rows than the height of the control). It would be nice if there was a way to tell the CListCtrl not to use the bottom piece of itself to display data.

2
Make the CListCtrl have no Scrollbars. Can't just remove the Horizontal bar. Infact CListCtrl will not creat any headers if the LVS_NOSCROLL style is used. Have the view handle the scrolling and send messages to the CListCtrl. Not what I want to do with a CFormView with two such CListCtrls.