Listview Alignment Question

Is there a way to align a Listview element using something similar to a HorizontalAlignment (Left/Center/Right) function?

I would like to be able to have some of the elements listed with an alignment to the left, and some to the right.

The nearest solution I can come up with is to store the data in a non-visible Listview and import the elements into a label that sits in a horizontal arrangement, one arrangement for each element.

Can anyone come up with a more graceful approach?

1 Like

Currently it is not possible to set alignment of ListView item.

But some time ago I had created PR for setting alignment of ListView text (main text, details text) maybe you will find it in future.

Here is the link of PR...

1 Like

Thanks.. I dont know what a PR is? Something that starts with P and then Request?

I am hoping this is a feature that will be added in the future. :slight_smile:

PR means Pull Request
let you tell others about changes you've pushed to a branch in a repository on GitHub.

1 Like

Here's a link to a thread with a couple of blocks based approaches ...
https://groups.google.com/g/mitappinventortest/c/WEat3QJXUX4/m/-r3mNVSIAwAJ

1 Like

@Carl_Aydelotte if your list data is static then it would be a good solution.

1 Like

@Carl_Aydelotte
perhaps this helps a bit?

4 Likes

I looked at some of the examples and got the gist of the Abbott & Costello text format .. that's pretty much the style that I am going for, but to convert from my ListView format to the Labels & Horizontal Arrangements version probably isn't worth my time.

I may be able to do something with the \t tab method .. but I need to think on that.

I thought about using a chat extension because they are designed for that but I have not found one that works with ListView yet.. if there is one out there I just haven't found it yet.

Hello Carl

Is your data in the ListView static or is it dependent on runtime input?

If static, you can use an HTML table to display each line (row) of data formatted as required - displayed in a WebView component (no internet required).

Hi Chris,

I am pretty heavily committed to List View at this point .. I am familiar with the method of using an HTML table and WebView.

At this point I am exploring converting the Listview Elements into HTML and Webview .. but I will need to keep ListView. I can store my data in Listview but not display the list .. convert it to HTML and display the Webview. I know it sounds like a lot of work for nothing but I am using the Listview in a non-traditional way with the imageName tag that I will not be able to replicate with WebView.

A few months ago I discovered that I can use the imageName portion of ListView to store data, and it does not display in ListView. It works fine.. and I use it heavily for my purposes. I am not displaying images anyway..

you can try some dynamic Component extension, with which you may create any type of layout.

Hi Kevin,

I may have to go th dynamic Component extension route until AI2 releases a version of ListView with text alignments.

Since its the holiday season, I may as well ask if they can also make it possible for ListView to let me assign a different background color to EACH element instead of one for all of them.. I could make nifty reports in the style of greenbar paper.. remember this stuff?

GreenBar

I think this would be a helpful feature for ListView.. at least it would be for me. But Im just one user..

You can do that within the Html Table too - make the font the same colour as the background and set the column width to 1px. Although of course you can use a Blocks List for data too.

Hi Chris .. not a bad idea.. did not think of that. I guess I could use Buttons to make the list pickable as well, I will need that function too..

You can use the cells of a column as buttons.
CAM_BUTTONS_50.aia (3.8 KB)

Create variable name and list and list2 and button-click call web1 get
The Code for right alignment


Result