Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 4249

Xojo2024R2: WebListBox with DataSource how to modify ColumnData?

$
0
0

I have ResultsList control (WebListBox with DataSource). I can set default column layout by modifying DataSource.ColumnData using code such as:

col = New WebListboxColumnData
col.DatabaseColumnName = "account_code" // the name of the field in your database or data source
col.Heading = "Account" // the name that appears above the column
col.Sortable = True // Whether or not the column is sortable
col.SortDirection = Weblistbox.SortDirections.Ascending // The default sort direction for the column
col.Width = "200"
cols.Add(col)

Return cols

I pass the query to the underlying DataSource class via SetQuery method ex:

QueryPageDataSource(ResultsList.DataSource).SetQuery (vQuery,Param1Field.text)
ResultsList.ReloadData

I need to change the layout of the ResultsList (aka modify column headings) to match another query send to the SetQuery method - the idea is to select the Report (aka query) from the list and then build the ResultsList.

I believe the ColumnData method is only used once which is OK for the default column layout but not if I send different query to the SetQuery method.

Assuming for simplicity that I know the number of columns needed and their respecting labels, how should I go about changing the column layout in the ResultsList?

13 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4249

Trending Articles