Var style As New WebStyle
Style.Value("text-align") = "center"
style.BackgroundColor = &cC0C0C0
style.BorderColor = Color.Black
style.ForegroundColor=Color.Red
style.BorderThickness = 1
style.FontSize=22
Style.Bold = True
Var cellRenderer As New WebListBoxStyleRenderer(style, "text of cell")
Listbox1.CellValueAt(1,0) = cellRenderer
Paweł, to jest dokładnie to czego potrzebowałem, dziękuję bardzo.
Great, thank you very much, assuming cell(1,3) this is exactly what I was looking for
Var style As New WebStyle
Var vText As String
Style.BackgroundColor=Color.Yellow
vText = MyList.CellTextAt(1,3)
Var cellRenderer As New WebListBoxStyleRenderer(style, vText)
MyList.CellValueAt(1,3) = cellRenderer
Further refinement assuming parameters pRowNo, pColNo, pType - this method will color cell in the web list box.
Var vStyle As New WebStyle
Var vText As String
vText = MyList.CellTextAt(pRowNo,pColNo)
Select Case pType
Case kAlertWarning
Style.BackgroundColor=Color.Yellow
Case kAlertError
Style.BackgroundColor=Color.Red
Else
Return
End Select
Var vCellRenderer As New WebListBoxStyleRenderer(style, vText)
MyList.CellValueAt(pRowNo,pColNo) = vCellRenderer
Style.BackgroundColor=Color.White // reset default value
I have added the last line to reset background color to keep the web page background color white after refresh.
Yeah, we’ve been talking about CellTextAt and we will probably split them. We will have dedicated methods for setting the text and setting the cell renderer, as it’s confusing. And they won’t return Variants anymore.
But for the moment, CellTextAt is the preferred way to use both, text and cell renderers.