Modifying the order of the columns of the list

Modifying the order of the columns of the list

Post by Kleberson Lui » Thu, 17 Jul 2003 07:28:38



I would like to know as I can modify the order of the
columns of my list. I am using the code:

void CB1::OnButTest()
{

        CHeaderCtrl* pHeaderCtrl = m_Grid.GetHeaderCtrl();

        if (pHeaderCtrl != NULL)
        {
                int nColumnCount = pHeaderCtrl-

Quote:>GetItemCount();

                LPINT pnOrder = (LPINT) malloc
(nColumnCount*sizeof(int));
                ASSERT(pnOrder != NULL);

                m_Grid.GetColumnOrderArray(pnOrder,
nColumnCount);

                int i, nTemp;

                for (i=1; i<5; i++)
                {
                        if (i==1)
                                nTemp = pnOrder[i];

                        pnOrder[i] = pnOrder[i+1];      

                }

                pnOrder[5] = nTemp;

                m_Grid.SetColumnOrderArray(nColumnCount,
pnOrder);

                free(pnOrder);

        }              

Quote:}

... and the column of list are:
        m_Grid.InsertColumn(0, (LPCTSTR) _T("Produto"),
LVCFMT_LEFT, 100);
        m_Grid.InsertColumn(1, (LPCTSTR) _T("Qtde"),
LVCFMT_LEFT, 60);
        m_Grid.InsertColumn(2, (LPCTSTR) _T("Pr. Cx."),
LVCFMT_LEFT, 60);
        m_Grid.InsertColumn(3, (LPCTSTR) _T("Pr. Un."),
LVCFMT_LEFT, 60);
        m_Grid.InsertColumn(4, (LPCTSTR) _T("Prazo"),
LVCFMT_LEFT, 60);
        m_Grid.InsertColumn(5, (LPCTSTR) _T("Subtotal"),
LVCFMT_LEFT, 60);

But only the titulos are being changed of place, with this
the content of the columns continue in the same place. I
would like to modify the positioning of the column with
its titulo and fields.
Can you help-me?

 
 
 

1. Windows 98 Explorer lists files in Date Modified Order

Recently my Win98 Explorer is always listing file views in Date order, not
Name order.  I can click on the name column and it does change, but as soon
as I change directories it goes back to date order.

I assume there is a Registry entry that controls this, but I can't find it.
Any ideas?

Thanks,

Ken

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Kenneth D. Hayber
Huntington Beach, CA 92647
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

2. can mail be password protected in Netscape 4?????/

3. SOURCE CODE : Dragging list view columns - rearranging columns

4. AVG & Adobe Software..

5. List Box ::GetSelItems() list return order??

6. To upgrade or not to upgrade

7. modifying column

8. NEW RIPSCRIP-2 ONLINE MULTIMEDIA TECHNOLOGY FOR BBS/WEB

9. Lost my 'date modified' column in Word open/save as dialog

10. Received column date ordering for Outlook

11. How to modify Pb3's atadisk driver in order to support IDE disk

12. columns in message list

13. hotmail - sent items - lists "from" in the "to"column