惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - 追逐苦痛

20230509001 - DataTable 导出成Excel 20230424001 - 打开文件对话框OpenFileDialog类 20200812001 - SQL openquery 传参数 ASP.net用Graphics实现的统计图(折线图、柱状图、饼图) 20190917002 - SQL 中处理交叉重复条件参考 20190917001 - 去除DataTable中重复的数据 20190410001 - 遍历控件参考 20180709001 - 委托传值 20180706001 - 动态添加 tabPage 20180519001 - DataTable Group by功能参考 20161020001 DataGridView 选中的 DataGridViewCheckBoxCell 不添加重复项 20161014006 DataGridView Combobox 数据绑定与传值 20161014001 DataGridView 单元格内容 自动计算 20161013001 DataGridView 数据转 DataTable 20161011001 treeView 递归 20160929001 Guid生成 20160815001 - 修改字段的长度 20160715001 - 分发与订阅 总结 20160712001 SQL server R2 更名
20230425001 - DataGridView绑定了数据之后, 再添加CheckBox列的解决方案
追逐苦痛 · 2023-04-25 · via 博客园 - 追逐苦痛

              if (dgv_M.Columns[0].Name != "select")
             {
                    DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();
                    checkBoxColumn.Name = "select";
                    checkBoxColumn.HeaderText = "选择";
                    dgv_M.Columns.Insert(0, checkBoxColumn);
                    dgv_M.ReadOnly = false;
                    dgv_M.Columns["ID"].ReadOnly = true;
                    dgv_M.Columns["单号"].ReadOnly = true;
            }

            if (dgv_M != null && dgv_M.Rows.Count > 0)
            {
                DialogResult result = MessageBox.Show("删除后不可恢复,\r\n确定需要删除吗?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    string str_Num = "";
                    for (int i2 = 0; i2 < dgv_M.Rows.Count; i2++)
                    {
                        string flag = dgv_M.Rows[i2].Cells["select"].EditedFormattedValue.ToString();
                        if (flag == "True")
                        {
                        }
                    }   

                }
            }