Hi!
I have database fudbalskiklub.mdf and I have a table in it:
Vesti (Messages)
in Vesti I have:
IDPoruke(Message ID)
Naslov(Subject)
Poruka(Body)
Vreme(DateTime.Now)
Procitano(was the message read or not)
I want c# to check for each row in Vesti if the message was read(1) or not (0)
and then if the value is 1 the text in listview in that line is bold if not then classic text
How can I do that?
Thanks!
Loading
Scott LyslePosted Dec 20, 2008, 12:49 AM
Why don't you return the results in a datareader, check the value (read) and then create and add a new listview item with the font set to bold or regular font depending upon whether or not the message was read:
ListViewItem
lvi = new ListViewItem();lvi.Font =
new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));lvi.Text =
"MessageRead";listView1.Items.Add(lvi);