Can Windows datagrids have rows of different colors?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top