如何对datagridView列进行排序? [英] how to sort datagridView column?

查看:111
本文介绍了如何对datagridView列进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家,
我的datagridview列是字母和数字的组合.最后一个字母结束后,我该如何对数字进行排序.
例如:我的亲戚是这样的..

hi experts,
my datagridview column is combination of alphabets and numbers. how can i sort numbers,after ending last alphabet.
ex: my coulumn is like this..

ap16as4779
ka07dh8342
ta5hk1234
ap16as677
ta5hk1233
zm1ap9


我需要将该列排序为此格式,


I need to sort that column to in this format,

zm1ap'9'
ka07dh'8342'
ap16as'677'
ap16as'4779'
ta5hk'1234'
ta5hk'1233'



为了快速理解,请使用单引号('''').我该怎么办...?

在此先感谢....



for quick understanding perpose i use this single quotes ('' ''). how can i do this...?

thanks in advance....

推荐答案

通过使用Sort方法,您可以像
一样对数据gridview进行排序
this.dataGridView1.Sort(this.dataGridView1.Columns ["Name"],ListSortDirection.Ascending);

并查看此链接,您可能会有所了解

DataGridView多列排序 [
By using Sort Method You can sort the data gridview like

this.dataGridView1.Sort(this.dataGridView1.Columns["Name"],ListSortDirection.Ascending);

and see this link you may get some idea

DataGridView Multi-column Sort[^]


这篇关于如何对datagridView列进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆