Xojo2025R1: ColumnTypeAt not working when using WebListBox with DataSource

Well, I was getting excited about the new column type feature for the WebListBox just to find out that it does not work when using DataSource. Now I am just a little disappointed.

Show a sample

1 Like

You need to specify the column type, or the cell type, in the DataSource itself.

For example, if you want to set one of the columns as a CheckBox, you can do it in the ColumnData method:

Var result() As WebListBoxColumnData

Var column As New WebListBoxColumnData("Test", "test", False)
column.ColumnType = WebListBox.CellTypes.CheckBox
result.Add(column)

Return result

If you need to change specific cells, it can be set in the RowData method (See WebListBoxRowData.CellTypeAt)

Example project:
WebListBoxDataSourceEdit.xojo_binary_project.zip (8.8 KB)

2 Likes

Well, it looks like DataSource.ColumnData method is the right place to add the code changing ColumnType, at least this time no error when running the app:

So thank you very much Ricardo, I think I have what I need to make it now more generic and data driven for all the lists and all columns.

Initially I just placed the code to change column type in the actual method building the specific list, getting error, hence my question, here it is fyi: