数据源为ObjectCollection时对DataGridView进行排序 [英] DataGridView sorting while Datasource is ObjectCollection

查看:66
本文介绍了数据源为ObjectCollection时对DataGridView进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DataGridView列排序中遇到麻烦.我的DataGridView DataSource是一个对象集合,这是数据绑定代码;

I am in trouble in DataGridView column sorting. My DataGridView DataSource is a object collection, here is the data binding code;

dgvStudents.AutoGenerateColumns = false;               
dgvStudents.DataSource = _oStudents; 


例外是:
DataGridView控件是数据绑定的.控件无法使用比较器执行排序操作.


the exception is:
DataGridView control is data-bound. The control cannot use the comparer to perform the sort operation.

please anyone can give me the suggestion?

推荐答案

看看这个

这篇关于数据源为ObjectCollection时对DataGridView进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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