C#DataGridView-如何使子表在datagrid行内并绑定到List对象. [英] C# DataGridView - How to make Child Table inside datagrid Row and binding to List object.

查看:242
本文介绍了C#DataGridView-如何使子表在datagrid行内并绑定到List对象.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个datagridview控件,该控件从我的对象集合中填充,然后每个对象都有一个由另一个对象集合组成的属性.
像这样的东西:

Hi All,

I have a datagridview control which populate from my object collections, then each objects have a property that consist of another object collection.
Something like:

public class Header
    {
        private int ID;
        private string formName;
        private DateTime dateLog;
        private string parentIdentifier;
        private string childIdentifier;
        private List<Details> logDetails = new List<Details>();
    }



问题:
有没有办法像树视图一样扩展/折叠datagridRow来查看子对象集合?

使用datagridview控件可以做到吗?

还是可以通过其他任何方式查看集合父对象"和子对象"集合.

我的Properor不允许我使用数据集.
任何人都可以帮助我.
谢谢,



Question:
Is there any way to expand/collapse datagridRow like treeview to view the child object collection?

Is this posible using datagridview control??

Or is there any other way to view both the Collection Parent objects and the collection of Child objects.

My Propersor don''t allow me to use datasets.
Anyone can please help me.
Thanks,

推荐答案

尝试 msdn文章.希望这会有所帮助!
Try this msdn article. Hope this helps!


这篇关于C#DataGridView-如何使子表在datagrid行内并绑定到List对象.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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