Enhance the Appearance of Your Web DataGrid

One way to enhance a Web DataGrid’s appearance is to alternate the background color of the row. This requires only two lines of code. For example, to display an even row as yellow, and an odd row as turquoise, you’d add the following lines in the Page_Load event:

If Not Page.IsPostBack Then   DataGrid1.ItemStyle.BackColor = Color.Yellow   DataGrid1.AlternatingItemStyle.BackColor = Color.Turquoise

To assign a color programmatically, use the predefined values of Color enumeration in the System.Drawing namespace. In VS.NET, enter Color and Intellisense to display the valid color name.

In case, you want to use the Hex value for color, then use the expression:

Color.FromName ("#00ee00") where #00ee00 is the Hex value.
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS