In the current build, sorting and right alignment are separate.
ListBox.Sort() still sorts from the cell text, so for formatted values use the cell text as the sortable key and use CellTag for the displayed value. Then custom draw the formatted value right-aligned.
# Example row setup:
Var amount As New Currency(100)
Var row As Integer = lb.AddRow(["2026-06-15", amount.ToString("0.00", Locale.Invariant)])
lb.SetCellTag(row, 0, "15/06/2026")
lb.SetCellTag(row, 1, "£" + amount.ToString("N2"))
lb.ColumnSortable = True
In the ListBox lb's PaintCellText() event handler:
If column <> 0 And column <> 1 Then Return False
Var text As String
If lb.CellTagAt(row, column) = Nothing Then
text = lb.CellTextAt(row, column)
Else
text = lb.CellTagAt(row, column).ToString()
End If
If selected Then
g.DrawingColour = ThemeColours.SelectionText
Else
g.DrawingColour = Colour.Black
End If
If column = 1 Then
g.TextAlignment = TextAlignment.Right
g.DrawText(text, g.Width - x, y)
Else
g.DrawText(text, x, y)
End If
Return True