devxlogo

List View Control and Structure in Data Attribute

List View Control and Structure in Data Attribute

Question:
I populate the list view control with the required items and each of these items are set with a pre-defined structure in the data attribute of the list view item.

When I access the data in the structure through some code it works fine in most of the cases. But in some cases, the data attribute loses the structure information and causes an error while reading from the attribute. What is wrong?

Answer:
This is one of those situations where PowerBuilder lets you do something but I would not recommend it.

I don’t recommend that you populate the data attribute of the listviewitem with a structure. Instead, I would recommend that you have an unbound array of structures in your program and store the index to the array in your listviewitem. This makes it faster and removes the problems you are encountering.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist