CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 1999
    Miami, FL

    Problems when reordering columns in listview control

    I have a listview control (in a dialog box) and I've changed the LVS_EX_HEADERDRAGDROP style
    so that the user can reorder the columns by dragging and dropping the headers. It works fine but I have three problems:

    1. After the user has reordered a column, I need to be notified somehow. How?

    2. If the user moves the first column to another location, a white vertical bar gets drawn after the new first column.

    3. You know how when you type a letter, it searches for the next matching item based on the first column? Well, when you reorder the columns and make a different column the first one, the typing is still used to search in the original column, instead of the new first one.

    I really appreciate your help me solve these issues.

  2. #2
    Join Date
    Feb 2012

    Re: Problems when reordering columns in listview control

    1.ON_NOTIFY_EX(HDN_ENDDRAG, 0, OnHeaderEndDragMethod)

    HWND HeaderCtrlHandle,
    int TotalColumns, int *lpiArray;
    //Header_GetOrderArray( HeaderCtrlHandle, TotalColumns,lpiArray);

    lpiArray Contain Column present columns order

    if u want new first column text
    GetItemText(Item(which item do u want),lpiArray[column]);
    don't give sub item values 0 or 1 give like lpiArray[0] or lpiArray[1];

    those will give present exact column values

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003

    Re: Problems when reordering columns in listview control

    13 years. A new record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.