Jesper Martensson
Jesper Martensson

Reputation: 1248

Setting different fonts/colors in a listview?

I have created a listview with 3 rows. If I would like to set different fonts/colors on the rows, how do I achieve this? So far I have tried different things without any sucess. This is my latest try, but honestly I have no clue what I am doing :D. Please help.

public String toString()

{
    return this.getAlias() + " " + this.dateFormat.format(this.getDate()) + "\n" + (Html.fromHtml("<i>" + this.getComment() + "</i>" + "<br />"));
}

Upvotes: 0

Views: 158

Answers (1)

Moin Zaman
Moin Zaman

Reputation: 25445

Add classes on your HTML elements and style them with CSS.

See an example here: http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx

Upvotes: 1

Related Questions