LISTVIEW - different styles

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • LISTVIEW - different styles

      Would it be possible to have, in a listview, 2 different styles on the rows?
      I mean, one row with an icon and text -> different column width definitions and the other row with other column definitions?

      See attachment for a better view of what I mean :)
      • screen.jpg

        8.46 kB, 138×110, viewed 2,363 times
    • Hello,

      not exactly clear what you want, but if you need "Warning Description" instead of the header then just place another widget (text or image...) over the header.

      If you need to do something more complicated, exactly a row with "one column style" inside the listview table, then you can set owner draw function where you can get the coords of the row and then draw "overlay data" (text, bitmaps...) in WM_PAINT handler of the listview callback.

    • Hi Alex,

      Thanks for the support in my issue.

      The window I want to create got 2 different Row styles, each 2 columns but with different content.
      As you can see one row style got left small icon and right a text.
      Depending on the amount of "warnings" or "faults" (orange rows) the other row style must start.
      This is a big text on the left side and a value on the right side.

      In the complete list I need to be able to scroll by pressing a button up or down.

      I think I will give it a try to set up one column in a row and have a play with the paint functions.

      Keep you guys posted :)
      • Capture.PNG

        49.11 kB, 847×164, viewed 319 times
    • Hello,

      if it is just some kind of an event log then things are a bit easier.

      Indeed you can do a listview with one column and use default API functions for setting a bitmap and bk color for warning and fault messages.

      For messages with the parameters values you can use owner draw function for justifying the text on opposite sides of a row.

    • Hi,

      The parameter values are updated every second .. so the left side (parameter name, text) is still the same, but the value (right side) can be different..

      So I need a system in the paint, where I can check in my one column, where is my parameter name and where is my parameter value? So I know how I can update only the value :)
    • I've found a work around.

      I've created 3 columns in my listView, and played with the content placing negative, so I could move it to the left, outside the defined column width.

      should be a nice feature, to define a style class on a listview row :)