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
    Location
    Miami, FL
    Posts
    972

    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.
    Alvaro


  2. #2
    Join Date
    Feb 2012
    Posts
    1

    Re: Problems when reordering columns in listview control

    1.ON_NOTIFY_EX(HDN_ENDDRAG, 0, OnHeaderEndDragMethod)

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

    lpiArray Contain Column present columns order

    lpiArray={1,0,2};
    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
    Location
    Florida
    Posts
    12,635

    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
  •  





Click Here to Expand Forum to Full Width

Featured