网格视图中的订单列 [英] order column in gridview
本文介绍了网格视图中的订单列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在C#中有一个gridview,我想添加显示顺序的列
此表格
1 A
2 B
3 C
4 D
5 E
i have a gridview in c#, i want add column that show the order
this form
1 A
2 B
3 C
4 D
5 E
推荐答案
您可以按照说的做:添加一列,并在其中添加行号+ 1.还要看看RowsHeadersVisible
和HeaderCell
属性.
You can do just as you said: Add a column and put the row number + 1 in it. Also take a look at theRowsHeadersVisible
andHeaderCell
properties.
dataGridView.RowHeadersVisible = true;
dataGridView.Rows[i].HeaderCell.Value = (i + 1).ToString()
IF您正在寻找有关如何对列进行排序的信息,然后在此处 [
IF you are looking for information on how to sort columns, then see here[^].
You can also check out msdn.
这篇关于网格视图中的订单列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文