我有一个包含列表的课程... [英] I have a class containing a list...

查看:74
本文介绍了我有一个包含列表的课程...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

并不是我通常会这样做,实际上我只是在研究.NET的DataGridView ...

但我有Person类,该类具有List< Address>作为财产.

我正在使用

Not that I would normally do this, I''m actually just goofing around with .NET''s DataGridView...

but I have class, Person, that has a List<Address> as a property.

I''m creating a BindingSource with a

DataSource=new List<Person>();


创建BindingSource
好的,好的,网格在个人"中显示属性.但是,哎呀,如果网格足够聪明以至于也可以将地址"公开为每个个人"记录的明细信息,这不是时髦的事吗?

我想这要求太多了,对吧?如果DevExpress网格支持我想要的行为,我会很好奇.谁知道.NET的DataGridView是否支持此概念?

谢谢!

Marc



OK, fine, the grid displays the properties in Person. But gee, wouldn''t it be snazzy if the grid were smart enough to also expose Address as a drill down for each Person record?

I suppose that''s asking for too much, right? I''ll be very curious if DevExpress'' grid supports the behavior that I want. Does anyone know if .NET''s DataGridView supports this concept though?

Thanks!

Marc

推荐答案

AFAIK DataGridView不支持此功能OOTB,但是您当然可以添加它.不幸的是,该控件没有像webform onrowdatabound事件那样的事件,您可以在检测到事件时仅添加子行.我猜您将不得不在OnPaint或RowPrePaint上进行此操作?
AFAIK the DataGridView doesn''t support this functionality OOTB, but you can of course add it. Unfortunately this control doesn''t have an event like the webform onrowdatabound event where you could just add the child rows when detected. I guess you''d have to do it the OnPaint, or maybe RowPrePaint?


这篇关于我有一个包含列表的课程...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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