I know that i can set custom colors to items when i add them to the list using OnDraw Events but i want to change colors of the items at a certain point after they are already in the list.
Show Image in Listview retrieve from database in ASP.net. Rate this: Please. But I have a problem to show the image in the list view. And images are stored in the database(SQL Server 2005). I want to bind images horizontally in listview how to do it using c# asp.net. HOW TO ADD AN ITEM IN A LISTVIEW AT RUNTIME? How can I add new item to a listview component at runtime? Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform.'
Is there a way to do this ?
opc0deopc0de
1 Answer
To redraw only certain items use the
UpdateItems
method. It has two input parameters where you can specify the range of the items to be redrawn. If you are going to redraw only one item, then just specify that one item index as a range.In this example I'm storing the color of the item into the
TListItem.Data
property and fading this color in the timer's event. After changing the value I call the UpdateItems
function which force the draw item event to fire. And yes, without DoubleBuffered
set, it flickers (even when you set the timer's interval e.g. to 500ms).TLamaTLama