How to set different color for each Group Header in WebGrid

Hi All,

Few weeks ago I got interesting inquiry from one of our customers, about how to set different color for each group header in WebGrid, and I think that it’s an interesting topics to be post on our corporate blogs.

Ok, first of all you need to bind your Webgrid and at the code behind inside WebGrid1_InitializeRow event, you can add the following code:

For more information, you can download the sample here. The sample used Northwind.mdb and the WebGrid bind to AccessDataSource.

If you have questions regarding this solution, please don’t hesitate to post the question in here.

Cheers,

Gordon Tumewu

Comments

  1. Excellent site intersoftpt.wordpress.com and I am really pleased to see you have what I am actually looking for here: this .. as it’s taken me literally 2 hours and 50 minutes of searching the web to find you (just kidding!) so I shall be pleased to become a regular visitor :)

Leave a Reply