当前位置:网站首页>DateGridView首列排序
DateGridView首列排序
2022-06-21 20:13:00 【金增辉】
第一步:初始化的时候,新建固定行数的表格
private void Form1_Load(object sender, EventArgs e)
{
int index = 0;
for (int i=1;i<=12;i++)
{
index = this.dataGridView1.Rows.Add();
this.dataGridView1.Rows[index].Cells[0].Value = i;
this.dataGridView1.Rows[index].Cells[1].Value = 1111111111;
}
}
第二步:新增事件,在删除行的时候执行下面的代码
private void dataGridView1_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
int index = this.dataGridView1.Rows.Add();
for (int i = 1; i <= 12; i++)
{
this.dataGridView1.Rows[i-1].Cells[0].Value = i;
}
MessageBox.Show("would you delete this row ?","Attention",MessageBoxButtons.YesNoCancel);
}
边栏推荐
- 挖财赠送的证券账户安全吗?可以开户吗?
- 大型语言模型教会智能体进化,OpenAI这项研究揭示了二者的互补关系
- How to associate the QR code of wechat applet to realize the integration of two codes
- China micro semiconductor has passed the registration: the annual revenue is 1.1 billion, and the actual controller is New Zealand nationality
- 做自媒体视频,如何写出热门爆款标题
- Summary of intelligence problems
- AWS CloudWatch
- LeetCode508-出现次数最多的子树元素和-深搜
- 杰理之做蓝牙发射时,将立体声修改成单声道差分输出时,接收端出现卡音【篇】
- 搭建Eureka-Server集群
猜你喜欢

杰理之做蓝牙发射的时候,回链没有声音解决方法【篇】

Which iPad apps can read English literature well?
![Time modification method for search device of Jerry's Bluetooth transmitter [chapter]](/img/ac/5a1d8cabbc61b24d451753e2f5c8dd.png)
Time modification method for search device of Jerry's Bluetooth transmitter [chapter]

How to associate the QR code of wechat applet to realize the integration of two codes

How to check the duplicate of an English paper?

China micro semiconductor has passed the registration: the annual revenue is 1.1 billion, and the actual controller is New Zealand nationality

B2B mall website helps enterprises speed up distribution and build an efficient and intelligent B2B online distribution platform

AWS CloudWatch

12. signal foundation

Huawei Hongmeng development lesson 3
随机推荐
Jerry's SD card reuse IIC precautions [chapter]
What websites or software are available to translate English literature into Chinese?
英文论文要怎么查重?
From casual to boring to sick
央企国电集团上海翔伟机电和中外海达成战略合作,捐赠2亿
How to associate the QR code of wechat applet to realize the integration of two codes
Mendeley installation, configuration and use
杰理之蓝牙发射器的搜索设备的时间修改方法【篇】
Abbkine细胞周期染色试剂盒特色和实验建议
有哪些将英文文献翻译为中文的网站或软件?
Overriding Overloading final
Go language unit test simulates service request and interface return
Qx2308 high efficiency PFM Synchronous Boost dc/dc converter
Spark 离线开发框架设计与实现
做自媒体视频,如何写出热门爆款标题
#16迭代器经典案例
2022佛山潭洲陶瓷展召开新闻发布会 推出展会十大重点
Tc3608h high efficiency 1.2MHz DC-DC booster IC
Excuse me, which website is better for college students to check literature?
Summary of internship interview experience of more than ten failed internship positions