StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Add BackColor/ForeColor properties to the...Expand / Collapse
Author
Message
Posted 06/04/2009 9:51:00 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
I would be really nice to be able to change column colors for the listview.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #23346
Posted 06/04/2009 10:05:52 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/31/2010 2:36:53 PM
Posts: 6,287, Visits: 6,191
Are you referring to the header or the area where the text is?  If you are referring to the text area, there is a new event called the RowPopulated (instead of RowPopulating) that gives you the entire column, list item ,etc.  So you could actually do this.

But here is a little sneak peek of something coming down the pike.  It won't be in the next release (but there may be some other goodies ), but here is a StrataListView that will ultimately replace the current ListView.  The StrataListView is 100% written from scratch and so there will be a lot more flexibility.  But this is something fun to look forward to

Notice that it will follow theme colors!  This will be in our medical app for a while before we release it...like we do most controls.  But once we work through the process it will make it into the framework.

Post #23349
Posted 06/04/2009 10:24:38 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
Trent L. Taylor (06/04/2009)
Are you referring to the header or the area where the text is? If you are referring to the text area, there is a new event called the RowPopulated (instead of RowPopulating) that gives you the entire column, list item ,etc. So you could actually do this.

Super, could you provide a quick sample code on how to change the backcolor of a column?

But here is a little sneak peek of something coming down the pike. It won't be in the next release (but there may be some other goodies ), but here is a StrataListView that will ultimately replace the current ListView. The StrataListView is 100% written from scratch and so there will be a lot more flexibility. But this is something fun to look forward to

That is just awesome, can't wait to get this in the framework.


Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #23350
Posted 06/05/2009 9:21:58 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
Trent,

In case you missed my response above, could you please provide a quick sample code on how to change the backcolor of a column in the ListView? I have tried different code and none worked.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #23375
Posted 06/05/2009 11:29:59 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/31/2010 2:36:53 PM
Posts: 6,287, Visits: 6,191
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
Post #23377
Posted 06/05/2009 1:36:27 PM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
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
(Using VB.Net 2010/SQL Server 2008)
Post #23385
Posted 06/06/2009 9:00:40 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/31/2010 2:36:53 PM
Posts: 6,287, Visits: 6,191
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.
Post #23389
Posted 06/12/2009 3:31:59 PM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
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


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
(Using VB.Net 2010/SQL Server 2008)
Post #23483
Posted 06/15/2009 6:59:19 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/31/2010 2:36:53 PM
Posts: 6,287, Visits: 6,191
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.
Post #23491
Posted 06/15/2009 8:26:47 AM


StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 9:52:36 PM
Posts: 1,653, Visits: 9,543
Thanks.

Edhy Rijo
(Using VB.Net 2010/SQL Server 2008)
Post #23498
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trent L. Taylor, Steve L. Taylor, Dustin Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:43am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.047. 8 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.