xpert001

Hi Dear,

I need to make the report view of the list control non sortable( Disable Sorting) at run time. But i could not find out any API.
I tried to set LVS_NOSORTHEADER in PreCreateWindow() but it is making the list view non sortable all the time.

I need to make it Non soratble only at run time.
Like if I click on a particular node in a tree view then the list view dispalyed corrresponding to that should be non sortable.

Can Any body help me



Re: Visual C++ General I Need to make the CListCtrl non sortable at run time

Ramkrishna Pawar

Have you tried CListCtrl :: SetExtendedStyle (MFC)






Re: Visual C++ General I Need to make the CListCtrl non sortable at run time

xpert001

I managed to find the solution. Thanks for consideration

CHeaderCtrl* pHeader = GetListCtrl().GetHeaderCtrl();

if( pHeader!=NULL)
{
pHeader->ModifyStyle(HDS_BUTTONS, 0); // disable the sorting.
}