Click here to Skip to main content
13,052,696 members (65,244 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi guys, now am in MFC project in which i am using document/view and MFC Ribbon's. I inherit my view class from CListView. I need to change my list ctrl columns when ribbon categories are switched.

In my search i found there is no event for Ribbon category selection change. I post question about this problem in many forums but i cant get the solution.

But some guys told me to use ON_UPDATE_COMMAND_UI() for the first button in every category but this also not suited because the handler is called for every WM_PAINT. If any one have any other idea for update my view when category selection change pls share with me guys......

Thanks in advance
Posted 10-Mar-11 20:04pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Dear ganeshIT,

clarify your question intelligibly.
1)Do you wnats to update the list view control?

2)Do you wants to set the selection change programatically.

Ans 1:
Use RedrawItems API.

BOOL RedrawItems( int nFirst, int nLast );
Forces a list view control to repaint a range of items.

The specified items are not actually repainted until the list view window receives a WM_PAINT message. To repaint immediately, call the WindowsUpdateWindow function after using this function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 Mar 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100