Skip to content

ListViewColumn Type not implemented... #519

Closed

Description

@itg-assistant

mitch stephens asked 2017-01-06 17:08:01 UTC

Hi guys,

So it looks like the ListView ColumnHeader does not have something equivalent to the VWG ListViewColumnType property, which lets you indicate the type of data in a column.

Is this intentional? Is there something equivalent?

I need it for several things:

  • Sorting listviews may need to treat some columns as numeric or date - you will get a different sort order treating everything as text.

  • Exporting listviews to Excel lets you set the target column to the correct data type

http://screencast.com/t/QXnHsIxi

Thanks

Mitch

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-01-06 18:37:11 UTC

    Hi Mitch,

    The ListViewColumnType is a VWG addition, it's not present in WinForms. We used WinForm as the base class model while removing all items that would be obsolete on a web platform (like 3D borders) and adding a lot of additional web-css3-html5 features. While our main goal (and necessity) was to replace VWG we also didn't want to replicate features that have probably been added over the years to cover various shortcomings (at least not from the start).

    The ListViewColumnType is a strange property since it doesn't specify just the data type (it has Icon and Control), it's only used to render the cells, and the only value type that can be stored in ListViewItem is a always a string anyway - unlike the DGV which supports any type. It looks like VWG tried to use the LV as a DGV with mixed results. The enumeration is a mix of data type and visual widget type (limited to Icon and Control).

    You can add a Type property (or any other property) to ColumnHeader or ListViewItem in two ways:

    • Extend ColumnHeader -> MyColumnHeader : ColumnHeder. The editor will automatically detect any subclass and will show you the list of subclasses at design time.

    • Or use the UserData property (all Wisej components have it and it's a lot better that the Tag object) like this: this.columnHeader1.UserData.valueType = typeof(int), or like this this.columnHeader1.UserData["valueType"] = typeof(int). The UserData property is a dynamic object that can store anything with any key.

    Best,

    Luca

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    mitch stephens answered 2017-01-06 18:59:39 UTC

    Ok, fair enough.   I don't disagree with your decision.

    I had started using the Tag property to store this value.

    Mitch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn improvement to something that already works.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions