Include data and group when using Control.AddItem() with a two-dimensional array

Adding items to a ListView via a two-dimensional array is much faster than adding them one by one. But is there a way to include the associated data and group as well? Maybe other properties, too (eg. checked value)? That way, you could truly add items in bulk.

I think the group can be set in a DialogListItem and you can pass a Vector or Map of these to AddItem.

Thanks for replying. To clarify, my question is about adding multiple items in bulk, including some of their properties and associated data. What you're suggesting is precisely the documented method for adding one item per call.

If you build the DialogListItems with their subitems and put them in a Vector, then you can add the Vector directly in Control.AddItem.
Isn't it what you want to do?
EDIT: OK, I get it. You do not get to build the DialogListItems, you can only retrieve them once they are added to the list.

Maybe I'm not following you, but how are you supposed to build a DialogListItem without adding it first? I think you're confusing building an array/vector with the column values with creating the actual object, which has its other properties. You can only set the related data and group for one item at a time. Related data may only be set when adding the item, as I don't think you can change it afterward.

You can do a quick test: add 100 items to a ListView one by one (it doesn't matter if you pass a Vector, so you can set multiple columns at once), then add all 100 items at once using a two-dimensional array. Compare the execution times of both methods.

My question was about whether you could perhaps pass a Vector of Maps and then use specific map keys to set properties on each DialogListItem object. That way you can add several items and also set some properties at once.

Yeah, you're right, your answer came at the same time I edited my previous message.
I forgot you can not build a DialogListItem "from scratch" or from the DOpusFactory.

From the docs, I don't think what you want can be done right now.

From the docs, all properties of a DialogListItems (except index and subitems) can either be read or written to.

I get it now, and think it'd be really usefull too.
That would require to find a way to avoid clashing between column names (user defined) and existing properties of the DialogListItem though ... maybe with yet another signature for AddItem (something like items: Vector<Map>, properties: Vector<Map>).
Another option would be to add DOpus.Create.DialogListItem(), with two signatures (an empty one and another one that lets you specify the subitems), so you get full control of all your DialogListItem before inserting them in a Vector and feeding Control.AddItem.