Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A listview by any other color is still the same listview
Message
From
24/02/2005 16:05:17
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00989888
Message ID:
00990313
Views:
27
Thanks Rex,

Yes it IS still cold and snowy. Don't you miss it?

By the way, I call your house the other day to see if you could provide some .Net training and found that you have left our part of the country. I hope all is going well for you.

Glenn

>Hi Glenn,
>
>I hear it is still cold up there <s>. Here is a link to a listview that does everything under the sun (or cold). If you have the time you may be able to pick it apart to see how they do it. http://www.codeproject.com/cs/miscctrl/aa_listview.asp
>
>Enjoy,
>Rex
>
>>Thanks Bonnie,
>>
>>I too can change the row colors but not the cell. It sure seems that the properties are available and there is neither a dev time or run time exception. Maybe this is a limitation of the control.
>>
>>Glenn
>>
>>>Glenn,
>>>
>>>I could get the rows to be a color, but not the columns. I don't know if that's a bug or if that's how it's supposed to work.
>>>
>>>~~Bonnie
>>>
>>>
>>>>I am having trouble changing the color of cells dynamically in a listview. Here is the code which I thought would work (but it doesn't)
>>>>
>>>>Const product_column As Integer = 0
>>>>Const productname_column As Integer = 1
>>>>Const units_instock_column As Integer = 2
>>>>Const units_onorder_column As Integer = 3
>>>>Const reorderlevel_column As Integer = 4
>>>>Const discontinued_column As Integer = 5
>>>>
>>>>With ListView1.Items
>>>>  .Add(myreader.Item("productid"))
>>>>  curentrow = .Count - 1
>>>>  .Item(curentrow).SubItems.Add(myreader.Item("productname"))
>>>>  .Item(curentrow).SubItems.Add(myreader.Item("unitsinstock"))
>>>>  .Item(curentrow).SubItems.Add(myreader.Item("unitsonorder"))
>>>>  .Item(curentrow).SubItems.Add(myreader.Item("reorderlevel"))
>>>>  .Item(curentrow).SubItems.Add(myreader.Item("discontinued"))
>>>>  If myreader.GetInt16(units_instock_column) <= myreader.GetInt16(reorderlevel_column) And _
>>>>	myreader.GetInt16(units_onorder_column) = 0 And _
>>>>	myreader.GetBoolean(discontinued_column) = False Then
>>>>    .Item(curentrow).SubItems.Item(units_instock_column).ForeColor = Drawing.Color.White
>>>>    .Item(curentrow).SubItems.Item(units_instock_column).BackColor = Drawing.Color.DarkRed
>>>>  Else
>>>>    .Item(curentrow).SubItems.Item(units_instock_column).ForeColor = Drawing.Color.DarkOliveGreen
>>>>    .Item(curentrow).SubItems.Item(units_instock_column).BackColor = Drawing.Color.DarkRed
>>>>  End If
>>>>End With
>>>>
>>>>
>>>>The listbox loads but I see no color changes. Am I color blind?
>>>>
>>>>Thanks
>>>>
>>>>Glenn
Previous
Reply
Map
View

Click here to load this message in the networking platform