How to span columns in CListCtrl
-
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint). Does anyone know if this has been done? Thanks! Eric ---------------------------------------- Please reply in the forum--email is filtered
-
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint). Does anyone know if this has been done? Thanks! Eric ---------------------------------------- Please reply in the forum--email is filtered
Eric Jacobsen wrote:
The MFC Grid Control doesn't seem to have this feature (hint hint).
Which implies that a list control certainly doesn't! Can you embed an Excel sheet into the application?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint). Does anyone know if this has been done? Thanks! Eric ---------------------------------------- Please reply in the forum--email is filtered
You could subclass the control and put code in to draw to text manually (just the "full line" text). Steve
-
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint). Does anyone know if this has been done? Thanks! Eric ---------------------------------------- Please reply in the forum--email is filtered
It's not supported by the control directly, but it isn't terribly difficult. Review the various custom draw articles in the CListCtrl section here on CP - you want to intercept drawing for a specific row, and draw it yourself.
---- I just want you to be happy; That's my only little wish...
-
Eric Jacobsen wrote:
The MFC Grid Control doesn't seem to have this feature (hint hint).
Which implies that a list control certainly doesn't! Can you embed an Excel sheet into the application?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
Yes, the Excel functionality is just what I'm thinking of, but I think embedding an Excel sheet would probably be overkill
-
It's not supported by the control directly, but it isn't terribly difficult. Review the various custom draw articles in the CListCtrl section here on CP - you want to intercept drawing for a specific row, and draw it yourself.
---- I just want you to be happy; That's my only little wish...
This is what I'm looking into now. I'm stumbling a little on the issue of how to derive from CListView because CListView HAS A CListCtrl, but supposedly can act as if it IS A CListCtrl. Thanks for the response...
-
This is what I'm looking into now. I'm stumbling a little on the issue of how to derive from CListView because CListView HAS A CListCtrl, but supposedly can act as if it IS A CListCtrl. Thanks for the response...
Actually, CListView IS a CListCtrl. If you look at the implementation of GetListCtrl(), it merely does
return (*(CListCtrl*)this);
or something similar.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Actually, CListView IS a CListCtrl. If you look at the implementation of GetListCtrl(), it merely does
return (*(CListCtrl*)this);
or something similar.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
This is news to me...Thanks.:-D
Jesus Lives Forever - Amen:rose:
--Owner drawn:rose: --An eye for an eye makes the whole world blind. --If you find my post helpful then do rate it. --Jesus is Lord:rose:
-
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint). Does anyone know if this has been done? Thanks! Eric ---------------------------------------- Please reply in the forum--email is filtered
Use custom draw to draw whatever you want in your user-message rows. See: Neat Stuff to do in List Controls Using Custom Draw[^] --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
Use custom draw to draw whatever you want in your user-message rows. See: Neat Stuff to do in List Controls Using Custom Draw[^] --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Thanks Mike, I had scanned your article and for some reason didn't think it was what I needed. It is EXACTLY what I needed, thanks. Since my derived CListView class IS A CListCtrl apparently, I'm using the ON_NOTIFY_REFLECT version. Embedding a CString pointer in the items lparam, and using DrawText to draw the string centered in the row. Returning *pResult = CDRF_SKIPDEFAULT to prevent any other drawing in these rows.
-
Thanks Mike, I had scanned your article and for some reason didn't think it was what I needed. It is EXACTLY what I needed, thanks. Since my derived CListView class IS A CListCtrl apparently, I'm using the ON_NOTIFY_REFLECT version. Embedding a CString pointer in the items lparam, and using DrawText to draw the string centered in the row. Returning *pResult = CDRF_SKIPDEFAULT to prevent any other drawing in these rows.
Hi, can you just me show the code for the same Regards Shri
-
Thanks Mike, I had scanned your article and for some reason didn't think it was what I needed. It is EXACTLY what I needed, thanks. Since my derived CListView class IS A CListCtrl apparently, I'm using the ON_NOTIFY_REFLECT version. Embedding a CString pointer in the items lparam, and using DrawText to draw the string centered in the row. Returning *pResult = CDRF_SKIPDEFAULT to prevent any other drawing in these rows.
Hi, can you just provide me the sample code for the same Regards Shri