动态添加DataGridView Row Color
来源:互联网 发布:犀牛软件 手机 编辑:程序博客网 时间:2024/05/16 06:35
private delegate void SetDataGridDataRowColor(DataGridView dv, int row, Color c); private void SetdataGridRowColor(DataGridView dv, int row, Color c) { if (dv.InvokeRequired) { dv.Invoke(new SetDataGridDataRowColor(SetdataGridRowColor), dv, row, c); } else { dv.Rows[row].DefaultCellStyle.BackColor = c; } } private delegate void SetDataGridDataRow(DataGridView dv, int row, string strLine); private void SetdataGridRow(DataGridView dv, int row, string strLine) { if (dv.InvokeRequired) { dv.Invoke(new SetDataGridDataRow(SetdataGridRow), dv, row, strLine); } else { int status = 0; bool superAnonymous = false; int id = int.Parse(dv.Rows[row].Cells["P_ID"].Value.ToString()); if (strLine.Contains(@"验证失败")) { dv.Rows[row].Cells["Status"].Value = 0; status = 0; dv.Rows[row].Cells["SuperAnonymous"].Value = false; dv.Rows[row].DefaultCellStyle.ForeColor = Color.DarkGray; } else { dv.Rows[row].Cells["Status"].Value = 1; status = 1; dv.Rows[row].Cells["SuperAnonymous"].Value = false; dv.Rows[row].DefaultCellStyle.ForeColor = Color.DarkOrange; } new DBOperator().ModifyProxy(id, status, superAnonymous); SetdataGridRowColor(ProxydataGridView, row, ProxydataGridView.DefaultCellStyle.BackColor); } } private delegate void SetDataGridDataRowSource(DataGridView dv, DataTable table); private void SetdataGridRowSource(DataGridView dv, DataTable table) { if (dv.InvokeRequired) { dv.Invoke(new SetDataGridDataRowSource(SetdataGridRowSource), dv, table); } else { dv.DataSource = table; } }
0 0
- 动态添加DataGridView Row Color
- DataGridView动态添加行
- datagridview 数据动态添加
- DataGridView动态添加数据
- DataGridView里动态添加comboBox
- JS 动态 添加 table的Row
- dataGridView为单元格动态添加按钮控件
- C# DataGridView控件 动态添加新行
- datagridview 动态添加列和行
- C# DataGridView控件 动态添加新行
- C# DataGridView控件 动态添加新行 .
- DataGridView控件 动态添加新行
- C# DataGridView控件 动态添加新行
- C# DataGridView控件 动态添加新行
- C# DataGridView控件 动态添加新行
- C# DataGridView控件 动态添加新行
- C# DataGridView控件动态添加新行
- C#datagridview动态添加行和列
- android 设置壁纸基本方法
- winSocket下接收unsigned 数据
- OJ------求int型数据在内存中存储时1的个数(二进制数中1的个数)
- 【HDU5826】physics(物理题 + 数学题)
- java变成最差实践
- 动态添加DataGridView Row Color
- MySQL查询数据
- 1004 Let the Balloon Rise
- GridView 组件的基本实现(本人也是个新手,哪里写的不对或者多余还请大家多多见谅)
- 链表
- 《React-Native系列》11、 图解RN布局之FlexBox,三分钟上手写RN界面
- ROS 学习 (1):publisher和subscriber消息 python
- iOS 修正拍出来的照片的方向
- Android studio的默认图标