[SOLVED] ListviewSubItem containing a button

Answered Closed
0
0

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

 

  • You must to post comments
Best Answer
0
0

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

 

  • redcard
    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
  • Luca (ITG)
  • redcard
    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)
  • Luca (ITG)
    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.
  • You must to post comments
0
0

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.

  • You must to post comments
Showing 2 results