M
Me
Hi all,
I've tried this in various ways a while back unsucessfully, but am having
another stab at it now so I thought I'd go ahead and post the question
while I'm looking into it.
I'm writing a csharp win app and want to color code the items in my
listbox dynamically depending upon the contents of each item.
I'm loading up the list box as follows:
listBox1.DisplayMember = "ID";
listBox1.ValueMember = "MyKey";
listBox1.DataSource = MyDataSet.Tables["MyTable"];
In past tries I've gone down the path of trying to cast the item as
System.Web.UI.WebControls.ListItem and using .Attributes.Add
("style","color:red") without sucess.
I've also gone the path of coding a custom listBox1_DrawItem - which also
didn't work due to a known kb issue that I ended up coming across.
I still feel that there HAS to be a way to do this that I'm missing...
anyone know of a way?
Thanks!
I've tried this in various ways a while back unsucessfully, but am having
another stab at it now so I thought I'd go ahead and post the question
while I'm looking into it.
I'm writing a csharp win app and want to color code the items in my
listbox dynamically depending upon the contents of each item.
I'm loading up the list box as follows:
listBox1.DisplayMember = "ID";
listBox1.ValueMember = "MyKey";
listBox1.DataSource = MyDataSet.Tables["MyTable"];
In past tries I've gone down the path of trying to cast the item as
System.Web.UI.WebControls.ListItem and using .Attributes.Add
("style","color:red") without sucess.
I've also gone the path of coding a custom listBox1_DrawItem - which also
didn't work due to a known kb issue that I ended up coming across.
I still feel that there HAS to be a way to do this that I'm missing...
anyone know of a way?
Thanks!