如何在datagridview中获得列的RANK? [英] How to get RANK of a column in datagridview?

查看:124
本文介绍了如何在datagridview中获得列的RANK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

你好,希望你们都做得很好。

我在vb.net的一个项目中工作,需要在另一个专栏中获得专栏的等级在DataGridView中单击一个Button,排序无关紧要只需要新列中的排名值。

提前谢谢。



我尝试了什么:



对不起,我没有尝试任何东西,因为我被困在这里,我不知道是什么要做。

Dear All,
Hello and hope you all doing well.
Im working in a project in vb.net and need to get the rank of column in another column in DataGridView by clicking a Button, the sort is doesn't matter just need the ranking value in the new column.
Thanks in advance.

What I have tried:

Sorry i didn't tried anything because i am stuck in this and i don't know what to do.

推荐答案

为了得到一个项目的等级,你必须对列中的数据进行排序。



因为你不想对gridview进行排序;



1.将列数据复制到数组

2 。对数组进行排序

3.遍历gridview行并找到数组中列的索引并将其放入rank列。
In order to get the rank of an item you will have to sort the data in the column.

As you do not want to sort the gridview;

1. copy the column data to an array
2. sort the array
3. walk the gridview rows and find the index of the column in the array and put that into the rank column.


这篇关于如何在datagridview中获得列的RANK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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