Monday, December 01, 2008

MS ListView Control in LN


In one of our project we used MS ListView Control to show the data in one table. So here what we did. If you want try this approach also, you should do next steps:
Go to designer, create new form
click on menu: Create\Object and choose MS ListView Control.
Set name to this object and then you can do what you wish with this control, some code:

Dim control As Variant
Dim lwItem As Variant
Set control = source.getObject("ListView")
Set lwItem = control.ListItems.add(1, "a1", "fio2", 0)
Set lwItem = control.ListItems.add(2, "a2", "fio3", 0)
Set lwItem = control.ListItems.add(3, "a3", "fio4", 0)
Set lwItem = control.ListItems.add(4, "a4", "fio5", 0)
Call control.refresh()

4 comments :

CASA said...

hey

Looks like a promising approach for replacing a table with multivalue fields commonly used to make a table inside a form.

Could you give more specifications on how to :
- programmatically define the number of columns (and headers)
- add content
- read content afterwards

this would be ideal stuff for a "show & tell thursday" piece :)

thxalot for sharing this!

Dmytro said...

Actually I can write manual how to use it. I will to find some free hours for this document.

Andrei Kouvchinnikov said...

I experienced that sometimes Notes crashes when such objects are used in forms/documents.

KALYAN said...

This is a very nice approach for showing reports.

Currently we tried it and works perfectly fine. Now, as an enhancement do you see a way to group rows like we do in notes view?

Kalyan