Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC VC10.0
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
ganeshIT
Posted 10-Mar-11 21:04pm

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 280
1 Maciej Los 280
2 BillWoodruff 240
3 Afzaal Ahmad Zeeshan 239
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 22 Mar 2011
Copyright © CodeProject, 1999-2014
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