简体   繁体   中英

Color DataGridView in Visual Studio

I am looking to have alternating datagridview rows.

Like so:

在此输入图像描述

You can arrange that in the AlternatingRowsDefaultCellStyle and RowsDefaultCellStyle property of your datagridview.


Step 1

Click on the button for your DataGridViewCellStyle

AlternatingRowsDefaultCellStyle

Step 2

Select the color for the alternating row

排回颜色


Repeat for the RowsDefaultCellStyle to have different colors. By default both are set to a back color of white. Adjust as you wish.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM