DataGrid

delectation 2008-10-20 10:45:31
winform中,怎么扩展DataGrid实现类似Excel的“自动筛选”功能??
...全文
169 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
delectation 2008-10-25
  • 打赏
  • 举报
回复
List <Customer> list = new List <Customer>();
Customer cust;

for (int i = 0; i < 20; i++)
{
cust = new Customer { Age = 29 + i, CustomerName = "Scott" + i, Birthday = DateTime.Now.AddMonths(i) };
list.Add(cust);
}

dataGrid1.DataSource = list;

DataGridTableStyle dgStyle = new DataGridTableStyle();
dgStyle.MappingName = "客户";
dataGrid1.TableStyles.Add(dgStyle);

Customer也实现了ICompareable接口,但是无法排序,为什么?
delectation 2008-10-23
  • 打赏
  • 举报
回复
List<Customer> list = new List<Customer>();
Customer cust;

for (int i = 0; i < 20; i++)
{
cust = new Customer { Age = 29 + i, CustomerName = "Scott" + i, Birthday = DateTime.Now.AddMonths(i) };
list.Add(cust);
}

dataGrid1.DataSource = list;

DataGridTableStyle dgStyle = new DataGridTableStyle();
dgStyle.MappingName = "客户";
dataGrid1.TableStyles.Add(dgStyle);


这样绑定之后,为什么GridColumnStyles.Count=0??
如果绑定datatable数据时,为什么会自动建立GridColumnStyles
wocow2316 2008-10-22
  • 打赏
  • 举报
回复
对他的数据源进行删选也可以啊
devilli 2008-10-22
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 guying999 的回复:]
使用第三方的一些datagrid,有这种功能.如Infragistics的grid
[/Quote]

支持
guying999 2008-10-22
  • 打赏
  • 举报
回复
使用第三方的一些datagrid,有这种功能.如Infragistics的grid
delectation 2008-10-22
  • 打赏
  • 举报
回复
能不能让header显示为一个combox?
paulin 2008-10-22
  • 打赏
  • 举报
回复
up
yangjinhui 2008-10-22
  • 打赏
  • 举报
回复
那是不是在bS中也就能实现了?
我很懒 2008-10-22
  • 打赏
  • 举报
回复
使用第三方的一些datagrid,有这种功能.如Infragistics的grid,或者自己写个控件网上有相关实例
delectation 2008-10-22
  • 打赏
  • 举报
回复
怎么样把头扩展?
delectation 2008-10-22
  • 打赏
  • 举报
回复
能不能让header显示为一个combox?
waikey 2008-10-20
  • 打赏
  • 举报
回复
有点难度
试下用自定义header啊
qqlpp 2008-10-20
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 delectation 的回复:]
没有一点思路,如何下行呀。
[/Quote]

SF的建议不错啊
优途科技 2008-10-20
  • 打赏
  • 举报
回复
只能自己包DataGrid了。DataGrid本身不支持的。
delectation 2008-10-20
  • 打赏
  • 举报
回复
没有一点思路,如何下行呀。
qinhl99 2008-10-20
  • 打赏
  • 举报
回复
略复杂写,帮顶
greystar 2008-10-20
  • 打赏
  • 举报
回复
使用第三方的一些datagrid,有这种功能.如Infragistics的grid
delectation 2008-10-20
  • 打赏
  • 举报
回复
也就说只有右击HitTestType.ColumnHeader,才显示右键菜单,其它情况下不显示。
delectation 2008-10-20
  • 打赏
  • 举报
回复
右击头时,怎么显示右键菜单?
qshzf 2008-10-20
  • 打赏
  • 举报
回复
up

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧