winform datagridview 如何设置datagridview隔行变色_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > winform datagridview 如何设置datagridview隔行变色

winform datagridview 如何设置datagridview隔行变色

 2017/11/16 3:03:24  流浪的松竹  程序员俱乐部  我要评论(0)
  • 摘要:如何设置隔行变色。如图:设置:只要设置如下属性,就行了。AlternatingRowsDefaultCellStyle属性获取或设置应用于DataGridView的奇数行的默认单元格样式。RowsDefaultCellStyle属性获取或设置应用于DataGridView的行单元格的默认样式。只需要增加以下代码即可实现隔行变色dataGridView1.RowsDefaultCellStyle.BackColor=Color.Bisque;dataGridView1
  • 标签:for view tag winform

如何设置隔行变色。

如图:

JSjwWkHQtIPeqfctQ/5cilpEMXEg/4xO07G733dCTx690uz7CdnqE7PUN3etgrz9CdnqF6Y73D95yO0Lu3fEoGGWv1PGmtWpOxgGMOmBTzsgN6E/Taf1bvm/n652NM3TbdxHxDs3O2ov2mJ0CildeOdIfnYw6cjz18IeGIX9KxgJQTQWmngjPcQjI9QrM8w7I9w7LdgjNOBqUdD0g+6pd05FLSbxcTDvvGG+4YRCcy3D2IrnQh/jAxbdBvvvG/XYj/TT+R8NvFhCOXEo9cSjx6KemYX/Ix/5Tj/qknLqedCkpzD870Dr96OvLamai8s1F556LzzkXnnY3MPR2W7RmS6RGc4X4lzT0ozT0ozS0ozf1KuvuVdM+QDK+QTK+QjNOhmd6hWd6hmWfCss6EZZ8Jzzobln0uPPtcZI5PVK5vVO6FmGsXY/IuxuZfisv3jysISCi8nFAYmFgUmFQcmFQUlFQclFwcnFISkloalnEjIrM8MvtWVM7t2Gv34vLvJxTcj8+/H59XQSgu925s7u3Yq7dicm4uK/tmbM6tuKu3467ejs+9HZ97O+HancRrdxLz7ibm3U3Kv5eUfy+ZUEEFodTC+3oV3U8rup9W9CC95EFGyaPM64+yrldmlT3OKnucfeNJzo2nOTeebuseHOwZHKQN8WhD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48VFhTU19ebTbS1tfH5mMNPD7QWdXXT29u7env7IFaBdYSIVV9f38bGRhd5t/r/A5FUCngjecFbAAAAAElFTkSuQmCC">

设置:只要设置如下属性,就行了。

AlternatingRowsDefaultCellStyle 属性
获取或设置应用于 DataGridView 的奇数行的默认单元格样式。
RowsDefaultCellStyle 属性
获取或设置应用于 DataGridView 的行单元格的默认样式。
只需要增加以下代码即可实现隔行变色
dataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque;
dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

发表评论
用户名: 匿名