471,306 Members | 1,237 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Can Windows datagrids have rows of different colors?

VMI
Can the Windows datagrid in VS.Net '05 have rows of different colors? I'm
trying to build an Outlook-style scheduler and I need to emulate the Calendar
so that the rows change colors based on the appointments I've made (i.e. a
row with no appointment has a different color than a row with a scheduled
appointment).

Thanks.
Feb 1 '06 #1
1 1475
VMI,
Yes, they can. You will need to implement a custom TextBoxColumn class
derived from DataGridTextBoxColumn, iterate over all the columns checking for
your "flag" text that triggers the coloring, and then apply that unique
TableStyle to all the cells in that row.

George Shepherds' Windows Forms FAQ site has some sample code.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"VMI" wrote:
Can the Windows datagrid in VS.Net '05 have rows of different colors? I'm
trying to build an Outlook-style scheduler and I need to emulate the Calendar
so that the rows change colors based on the appointments I've made (i.e. a
row with no appointment has a different color than a row with a scheduled
appointment).

Thanks.

Feb 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by melanieab | last post: by
2 posts views Thread by David R. Longnecker | last post: by
2 posts views Thread by simchajoy2000 | last post: by
3 posts views Thread by Mark Wiewel | last post: by
1 post views Thread by nido | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.