Skip to content

ListviewSubItem containing a button #425

Closed

Description

@itg-assistant

redcard asked 2016-11-23 21:14:27 UTC

Hello, our existing VWG app adds listview subitems that contain a button.

Button btn = new Button();

  • btn.Click += ...;*
  • btn.ImageSource = ...;*

ListViewItem newItem = listview.items.Add(...);
newItem.SubItems.Add(btn);

This fails to compile in WiseJ.  Any suggestions on how to accomplish this?

Thanks,
Andrew

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-23 21:26:55 UTC

    In details view only? Isn't that basically a datagrid with a button cell?

    We can't add controls to ListViewItem (actually we can, but  it's an overkill approach since you have to create the controls on the server and the client). The listview (and datagrid view) are based on a data stream (data store) class that receives only data and style info from the server and renders only the viewable area in the dom. The different cells in the datagridview are accomplished through cell renderers in javascript, that's how we have the image, button, link, and other cells.

    Creating an actual button control to place it in a cell works if you have few rows, but it quickly uses too many resources when creating hundreds or thousands of rows.

    We are looking into implementing custom ColumnHeader classes  like the DataGridViewColumn classes to support different views for the cells. Can you send me a screenshot of what you need the listview to look like or better a small VWG sample?

    Thanks,

    Luca

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    redcard answered 2016-11-23 21:32:53 UTC

    I’ll try to put together a small VWG sample app for you. To what email address should I send it? For now I will consider changing that listview into a datagrid. Thanks

  3. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-23 21:36:31 UTC

    support@wisej.com thanks!

  4. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    redcard answered 2016-11-23 21:41:02 UTC

    Followup question: Are you also considering adding a Type property to column headers? Our application makes many uses of that:

    if(listView.Columns[i].Type == ListViewColumnType.Icon)

  5. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-23 21:45:13 UTC

    Add the ListViewColumnType to the sample. Using the ListViewColumnType enum could be a way for us to restrict and simplify the implementation for the ListView while leaving more flexibility to the DataGridView.

  6. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Marco Yaler answered 2016-11-24 08:38:39 UTC

    While you are working on the listview :

    Does Wisej support displaying a panel upon clicking on a listview row ? This was a very powerful option in VWG.

    This makes room underneath the select row to display details inline the listview.

    See attachment for a sample view after a listviewitem has been clicked.

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

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions