当前位置:编程学习 > C#/ASP.NET >>

Dev WindowsForms BandedGridView

Dev WindowsForms  BandedGridView 设置某行某列的颜色
就像dataGridView那样 
例如
 for (int i = 0; i < dataGridView2.Columns.Count; i++)
                    {
                        for (int x = 0; x < dataGridView2.Rows.Count - 1; x++)
                        {
                            if (dataGridView2.Rows[x].Cells[i].Value.ToString() == "-1")
                            {
                                DataGridViewCellStyle style = dataGridView2.Rows[x].Cells[i].Style;
                                style.BackColor = Color.Green;
                            }
                        }
                    }
补充:.NET技术 ,  组件/控件开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,