本文介绍了删除并重新排序datagridview中的序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在c#windows应用程序中从datagridview删除行时如何重新排序序列号的编码。以及如何通过在datagridview中选择它来删除行。请注意,datagrid视图与数据库连接。例如。



Sr. No. City

1 Delhi

2 Mumbai

3 Chennai

删除Sr. No. 2后,序列号3替换它并显示sr no2而不是3.



Sr 。号城市

1德里

2钦奈



我尝试过:



i试过这个但是我无法做到这一点

i want to know the coding about how to reorder the serial number when we delete a row from datagridview in c# windows application. and also how to delete a row by just selecting it in datagridview. note that datagrid view is connected with database. eg.

Sr. No. City
1 Delhi
2 Mumbai
3 Chennai
After deleting the Sr. No. 2 the serial number 3 replace it and show sr no2 instead of 3.

Sr. No. City
1 Delhi
2 Chennai

What I have tried:

i have tried this but i am unable to do this

推荐答案


这篇关于删除并重新排序datagridview中的序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 23:41