Add BackColor/ForeColor properties to the ListView columns


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I would be really nice to be able to change column colors for the listview.

Edhy Rijo

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I was thinking the row, not the column. If you want to render the column, you will have to do an owner draw, which means you have to render all columns. It isn't that hard, but it will definitely be more work than just setting a property. This is something that will be in the future StrataListView control. Adding this logic to the existing ListView would require an entire Owner draw...thus using the new control would be more logical. Sorry Unsure
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (06/05/2009)
I was thinking the row, not the column.


I understand. Could you elaborate why would be use the RowPopulated instead of the RowPopulating?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
In short, it exposes the entire ListView Item so you can set anything on it you like such as the fore color, back color, etc.  You are given direct access to the ListViewItem properties.  That is really the only purpose.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (06/05/2009)
... If you want to render the column, you will have to do an owner draw, which means you have to render all columns. It isn't that hard, but it will definitely be more work than just setting a property. This is something that will be in the future StrataListView control. Adding this logic to the existing ListView would require an entire Owner draw...thus using the new control would be more logical. Sorry Unsure




I am really in the need to add BackColor to a couple of columns in a several ListView, do have any sample or reference code that I may use as start point to try to get this done?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There are a ton of them out on the web. Just search for ListView and OwnerDraw:



http://www.codeproject.com/KB/list/EXListView.aspx



http://www.experts-exchange.com/Programming/Languages/.NET/Q_20872868.html



This is just a function of the standard .NET ListView and handling that event. In the event you will be given the bounds, column and row information then you just render as you require. This does require some effort. This is also something that we do not intend to change on the existing ListView as it would require a lot of effort to make this a "global" resolution and our efforts would be better served on the new StrataListView control.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Edhy Rijo - 16 Years Ago
Edhy Rijo - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                         [quote][b]Trent L. Taylor (06/05/2009)[/b][hr]I was thinking the row,...
Edhy Rijo - 16 Years Ago
                             In short, it exposes the entire ListView Item so you can set anything...
Trent L. Taylor - 16 Years Ago
                         [quote][b]Trent L. Taylor (06/05/2009)[/b][hr]... If you want to...
Edhy Rijo - 16 Years Ago
                             There are a ton of them out on the web. Just search for ListView and...
Trent L. Taylor - 16 Years Ago
                                 Thanks.
Edhy Rijo - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search